 184 | A JPA Persistence Unit is a logical grouping of user defined persistable classes (entity classes, embeddable classes and mapped superclasses) with related settings. Defining a persistence unit is optional when using ObjectDB, but required by JPA. persistence.xml Persistence units are defined in |
 179 | ) and selecting New > Entity Class... (or New > Other... > Persistence > Entity Class and clicking ... the [Provider and Database] step just click Finish to generate a default persistence.xml file with a default persistence unit (that will be configured later). If the Finish button is disabled |
 179 | ) and selecting New > Entity Class... (or New > Other... > Persistence > Entity Class and clicking ... the [Provider and Database] step click Finish to generate a default persistence.xml file with a default persistence unit (that will be configured later). If the Finish button is disabled |
 178 | .Date;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
@Entity
public class Guest implements Serializable {
private static final long serialVersionUID = 1L;
// Persistent Fields:
@Id @GeneratedValue
Long id |
 178 | .persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
@Entity ... ;
// Persistent Fields:
@Id @GeneratedValue
Long id;
private String name ... guests in the database. We also need to configure JPA by setting a META-INF/persistence.xml file |
 160 | The term persistable types refers to data types that can be used in storing data in the database. ObjectDB supports all the JPA persistable types, which are: User defined classes - Entity classes ... can be stored in the database directly. Other persistable types can be embedded in entity classes as fields. In |
 149 | The Java Persistence API (JPA) is a standard API for accessing databases from within Java ... . Using plain old Java objects (POJO) to represent persistent data can significantly simplify database ... Persistence API (JPA). By interacting with ObjectDB using standard JPA you can keep your application |
 71 | New entity objects can be stored in the database either explicitly by invoking the persist method or implicitly as a result of a cascade operation. Explicit Persist The following code stores ... ", "Joseph", "Wurzelbacher");
em.getTransaction().begin();
em.persist(employee);
em |
 64 | " />
<persist serialization="false" />
persist always="auto" on-persist="false" on-commit="true" />
persistable types on the fly |
 60 | Working with the Java Persistence API (JPA) consists of using the following interfaces: Overview ... a static factory method of the JPA bootstrap class, Persistence:
EntityManagerFactory emf =
Persistence.createEntityManagerFactory("myDbFile.odb");
Another form |