concept persistence in category spring

appears as: persistence
Spring in Action, Sixth Edition

This is an excerpt from Manning's book Spring in Action, Sixth Edition.

Your domain classes are now ready for persistence. Let’s see how to use JdbcTemplate to read and write them to a database.

Listing 3.14. Preparing the Taco class for persistence.
package tacos;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.validation.constraints.Digits;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;

import org.hibernate.validator.constraints.CreditCardNumber;
import org.springframework.data.annotation.Id;
import org.springframework.data.relational.core.mapping.Table;

import lombok.Data;

@Data
@Table
public class TacoOrder implements Serializable {

  private static final long serialVersionUID = 1L;

  @Id
  private Long id;

  ...

}
Spring Roo in Action

This is an excerpt from Manning's book Spring Roo in Action.

  • Persistence—Components that access various data sources using APIs such as JDBC, object-relational mapping APIs such as Hibernate or JPA, or even messaging beans that access message queues via JMS.
  • roo> [TAB]
    !             */            /*             //
    ;             addon         backup         class
    controller    date          dependenc      development
    dod           download      email          enum
    exit          field         flash          focus
    help          hint          interface      jms
    jpa           json          logging        metadata
    mongo         osgi          perform        persistence
    pgp           poll          process        properties
    proxy         quit          reference      script
    service       system        test           version
    web
    roo>

    In this chapter, you’ll learn how to store and load data from relational databases. You’ll start by defining object-relational mapping (ORM) APIs and the standard Java Persistence API, and then learn how to configure persistence in a project using the Roo shell. Next, you’ll define Roo entities, which are an enhanced version of the standard JPA Entity class. You’ll create entity components in the shell, and we’ll show you how to load, persist, and remove them, using Roo’s JUnit-based integration test framework.