About entities

11-20 of 200Refresh
Tutorial
174

Step 2: Define a JPA Entity Class

To store objects in an ObjectDB database using JPA we need to define an entity class: Right click ... ; import java.io.Serializable; import javax.persistence.*; @Entity public class Point ... objects in the database. Apart from the @Entity annotation and the id field (and its annotations
Tutorial
174

Step 2: Define a JPA Entity Class

To store objects in an ObjectDB database using JPA we need to define an entity class: Open the [New ... .Serializable; import java.sql.Date; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; @Entity public class Guest implements Serializable
Manual
172

Chapter 2 - JPA Entity Classes

JPA Entity classes are user defined classes whose instances can be stored in a database. To store data in an ObjectDB database using JPA you have to define entity classes that represent your application data object model. This chapter explains how to define and use entity classes. 
Manual
164

JPA Entity Fields

Fields of persistable user defined classes (entity classes, embeddable classes and mapped ... and inverse fields) can be used in both entity classes and embeddable classes. However, the last two groups (primary key and version fields) can only be used in entity classes. Primary key fields
Manual
159

Retrieving JPA Entity Objects

of the database. The persistence context serves as a cache of retrieved entity objects. If a requested entity object is not found in the persistence context a new object is constructed and filled with data that is retrieved from the database (or from the L2 cache - if enabled). The new entity object
Manual
156

Working with JPA Entity Objects

Entity objects are in-memory instances of entity classes (persistable user defined classes ... requires using entity objects for many operations, including storing, retrieving, updating and deleting database objects. Entity Object Life Cycle The life cycle of entity objects consists of four states
Manual
153

Detached Entity Objects

Detached entity objects are objects in a special state in which they are not managed by any EntityManager but still represent objects in the database. Compared to managed entity objects, detached ... that have been loaded before detachment should be used. Changes to detached entity objects are not stored in
Manual
152

Shared (L2) Entity Cache

Every EntityManager owns a persistence context, which is a collection of all the entity objects ... an entity object that is already managed by the EntityManager returns the existing instance from the persistence context, rather than a new instantiated entity object. The scope of the persistence context
Manual
147

Deleting JPA Entity Objects

Existing entity objects can be deleted from the database either explicitly by invoking the remove ... (); The entity object is physically deleted from the database when the transaction is committed. Embedded objects that are contained in the entity object are also deleted. If the transaction is rolled
Manual
81

JPA Persistable Types

. ObjectDB supports all the JPA persistable types, which are: User defined classes - Entity classes ... and Serializable types (user or system defined). Note: Only instances of entity classes can be stored in the database directly. Other persistable types can be embedded in entity classes as fields. In