ObjectDB Database Search

1-50 of 200 results

Step 2: Entity Class and Persistence Unit

.Serializable; import java.sql.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; private

jakarta.persistence.PersistenceUnitUtil

the persistence unit . The methods of this interface should only be invoked on entity instances obtained from or managed by entity managers for this persistence unit or on new entity instances. Since: Jakarta ... class if the given entity belonging to the persistence unit and to an open persistence context

jakarta.persistence.EntityManagerFactory

: AutoCloseable Interface used to interact with the persistence unit , and to create new instances of EntityManager . A persistence unit defines the set of all classes that are related or grouped by ... participate in an association, then they must belong to the same persistence unit . A persistence unit

jakarta.persistence.EntityManager

to the associated persistence unit . An application-managed EntityManager may be created ... ; If the persistence unit has resource local transaction management, transactions must be managed using ... not denote an entity type belonging to the persistence unit , or if the second argument is not

Storing JPA Entities

.xml , or in another location that is specified in the persistence unit definition in persistence ... Using Jakarta Persistence (JPA) You can store new entities in the database either explicitly by calling the persist method or implicitly through a cascade operation. Explicit persist The following

JPA Lifecycle Events

listeners are applied automatically to all entities in a persistence unit . You can define default listeners ... unit definition in persistence .xml . To exclude an entity class and its subclasses from using ... is invoked: @PrePersist : Invoked before a new entity is persisted (when persist () is called

Setting and Tuning of JPA Queries

most global to most local: For the entire persistence unit , use a persistence .xml property ... query hints: "jakarta. persistence .query.timeout" - Sets the maximum query execution time in milliseconds. A QueryTimeoutException is thrown if the timeout is exceeded. "jakarta. persistence .lock

jakarta.persistence.NamedEntityGraph

entity. Entity graph names must be unique within the persistence unit . Default: "" Since: Jakarta ... Jakarta Persistence (JPA) Annotation Type jakarta. persistence .NamedEntityGraph Implemented ... , and may be passed to EntityManager.find . Since: Jakarta Persistence (JPA) 2.1 Annotation Elements String

jakarta.persistence.Converter

entity in the persistence unit , except for attributes for which conversion is overridden by means ... Jakarta Persistence (JPA) Annotation Type jakarta. persistence .Converter Implemented Interfaces ... type parameter of AttributeConverter . If autoApply = true , the persistence provider

jakarta.persistence.NamedNativeQueries

to the persistence unit . The NamedNativeQueries annotation can be applied to an entity or mapped superclass. See Also: NamedNativeQuery Since: Jakarta Persistence (JPA) 1.0 Annotation Elements ... Jakarta Persistence (JPA) Annotation Type jakarta. persistence .NamedNativeQueries Implemented

jakarta.persistence.PersistenceUnitUtil.load(Object,String)

persistent attribute of an entity belonging to the persistence unit and to an open persistence context ... belonging to the persistence unit . PersistenceException - if the entity is not associated ... Jakarta Persistence (JPA) Method in jakarta. persistence .PersistenceUnitUtil void load (  

jakarta.persistence.PersistenceUnitUtil.load(E,Attribute)

attribute of an entity belonging to the persistence unit and to an open persistence context ... to the persistence unit . PersistenceException - if the entity is not associated with an open ... Jakarta Persistence (JPA) Method in jakarta. persistence .PersistenceUnitUtil void load (  

jakarta.persistence.PersistenceUnitUtil.load(Object)

Jakarta Persistence (JPA) Method in jakarta. persistence .PersistenceUnitUtil void load (    Object entity ) Load the persistent state of an entity belonging to the persistence unit ... to the persistence unit . PersistenceException - if the entity is not associated with an open persistence context

jakarta.persistence.PersistenceContext.unitName

Jakarta Persistence (JPA) Method in jakarta. persistence .PersistenceContext String unitName (Optional) The name of the persistence unit as defined in the persistence .xml file. If the unitName element is specified, the persistence unit for the entity manager that is accessible in JNDI

jakarta.persistence.PersistenceUnit.unitName

Jakarta Persistence (JPA) Method in jakarta. persistence .PersistenceUnit String unitName (Optional) The name of the persistence unit as defined in the persistence .xml file. If specified, the persistence unit for the entity manager factory that is accessible in JNDI must have the same name. Default: "" Since: Jakarta Persistence (JPA) 1.0

jakarta.persistence.PersistenceUnitUtil.isLoaded(Object,String)

persistent attribute of an entity belonging to the persistence unit . Parameters: attributeName - name ... Jakarta Persistence (JPA) Method in jakarta. persistence .PersistenceUnitUtil boolean isLoaded ... Returns: false if entity's state has not been loaded or if the attribute state has not been loaded, else true. Since: Jakarta Persistence (JPA) 1.0

jakarta.persistence.PersistenceUnitUtil.isLoaded(E,Attribute)

persistent attribute of an entity belonging to the persistence unit . Parameters: attribute - attribute ... Jakarta Persistence (JPA) Method in jakarta. persistence .PersistenceUnitUtil boolean isLoaded ... if entity's state has not been loaded or if the attribute state has not been loaded, else true. Since: Jakarta Persistence (JPA) 3.2

jakarta.persistence.PersistenceConfiguration.property(String,Object)

Jakarta Persistence (JPA) Method in jakarta. persistence .PersistenceConfiguration PersistenceConfiguration property (    String name ,    Object value ) Set a property of this persistence unit . Parameters: name - the property name value - the property value Returns: this configuration. Since: Jakarta Persistence (JPA) 1.0

jakarta.persistence.PersistenceConfiguration.properties(Map)

Jakarta Persistence (JPA) Method in jakarta. persistence .PersistenceConfiguration PersistenceConfiguration properties (    Map properties ) Set multiple properties of this persistence unit . Parameters: properties - the properties Returns: this configuration. Since: Jakarta Persistence (JPA) 1.0

jakarta.persistence.PersistenceConfiguration.sharedCacheMode(SharedCacheMode)

Jakarta Persistence (JPA) Method in jakarta. persistence .PersistenceConfiguration PersistenceConfiguration sharedCacheMode (    SharedCacheMode sharedCacheMode ) Specify the shared cache mode for the persistence unit . Parameters: sharedCacheMode - the shared cache mode Returns: this configuration. Since: Jakarta Persistence (JPA) 1.0

jakarta.persistence.PersistenceConfiguration.validationMode(ValidationMode)

Jakarta Persistence (JPA) Method in jakarta. persistence .PersistenceConfiguration PersistenceConfiguration validationMode (    ValidationMode validationMode ) Specify the validation mode for the persistence unit . Parameters: validationMode - the shared cache mode Returns: this configuration. Since: Jakarta Persistence (JPA) 1.0

jakarta.persistence.PersistenceUnitUtil.isLoaded(Object)

Jakarta Persistence (JPA) Method in jakarta. persistence .PersistenceUnitUtil boolean isLoaded (    Object entity ) Determine the load state of an entity belonging to the persistence unit ... whose load state is to be determined Returns: false if the entity has not been loaded, else true. Since: Jakarta Persistence (JPA) 1.0

jakarta.persistence.Persistence.PERSISTENCE_PROVIDER

Jakarta Persistence (JPA) Field in jakarta. persistence . Persistence PERSISTENCE _PROVIDER This final ... Deprecated: TODO: Either change TCK reference to PERSISTENCE _PROVIDER field to expect "jakarta. persistence .spi.PersistenceProvider" or remove PERSISTENCE _PROVIDER field and also update TCK signature tests. Since: Jakarta Persistence (JPA) 1.0

jakarta.persistence.EntityGraph

Jakarta Persistence (JPA) Interface jakarta. persistence .EntityGraph Type Parameters: - The type ... Persistence (JPA) 2.1 Public Instance Methods AttributeNode addAttributeNode ( String attributeName ... .. Since: Jakarta Persistence (JPA) 3.2 AttributeNode addAttributeNode ( Attribute attribute ) Get an existing

jakarta.persistence.Graph

Jakarta Persistence (JPA) Interface jakarta. persistence .Graph Declares operations common to EntityGraph and Subgraph . See Also: EntityGraph Subgraph Since: Jakarta Persistence (JPA) 3.2 Public ... is not an attribute of this entity.. Since: Jakarta Persistence (JPA) 3.2 AttributeNode

jakarta.persistence.JoinTable

Jakarta Persistence (JPA) Annotation Type jakarta. persistence .JoinTable Implemented Interfaces ... ", referencedColumnName = "ID")) This annotation may not be applied to a persistent field or property not annotated ... Persistence (JPA) 1.0 Annotation Elements String name (Optional) The name of the join table. Defaults

jakarta.persistence.JoinColumn

Jakarta Persistence (JPA) Annotation Type jakarta. persistence .JoinColumn Implemented Interfaces ... CollectionTable ForeignKey Since: Jakarta Persistence (JPA) 1.0 Annotation Elements String name (Optional ... Persistence (JPA) 1.0 String referencedColumnName (Optional) The name of the column referenced by

jakarta.persistence.MapKeyColumn

Jakarta Persistence (JPA) Annotation Type jakarta. persistence .MapKeyColumn Implemented Interfaces ... to filename ... } Since: Jakarta Persistence (JPA) 2.0 Annotation Elements String name (Optional ... relationship field or property; " _ "; " KEY ". Default: "" Since: Jakarta Persistence (JPA) 1.0 boolean

jakarta.persistence.MapKeyJoinColumn

Jakarta Persistence (JPA) Annotation Type jakarta. persistence .MapKeyJoinColumn Implemented ... ; ... } See Also: ForeignKey Since: Jakarta Persistence (JPA) 2.0 Annotation Elements String name ... ; " _ "; " KEY ". Default: "" Since: Jakarta Persistence (JPA) 1.0 String referencedColumnName (Optional

jakarta.persistence.GenerationType

Jakarta Persistence (JPA) Enum jakarta. persistence .GenerationType java.lang.Object ∟ java.lang.Enum ∟ jakarta. persistence .GenerationType Implemented Interfaces: Constable , Comparable , Serializable ... Persistence (JPA) 1.0 The Auto Generated Values article explains how to use GenerationType . Enum

jakarta.persistence.LockModeType

Jakarta Persistence (JPA) Enum jakarta. persistence .LockModeType java.lang.Object ∟ java.lang.Enum ∟ jakarta. persistence .LockModeType Implemented Interfaces: FindOption , RefreshOption , Constable ... (increment) to the entity's version column. The persistence implementation is not required to support

jakarta.persistence.EntityExistsException

Jakarta Persistence (JPA) Class jakarta. persistence .EntityExistsException java.lang.Object ∟ java.lang.Throwable ∟ java.lang.Exception ∟ java.lang.RuntimeException ∟ jakarta. persistence .PersistenceException ∟ jakarta. persistence .EntityExistsException Implemented Interfaces: Serializable Thrown by

jakarta.persistence.PessimisticLockException

Jakarta Persistence (JPA) Class jakarta. persistence .PessimisticLockException java.lang.Object ∟ java.lang.Throwable ∟ java.lang.Exception ∟ java.lang.RuntimeException ∟ jakarta. persistence .PersistenceException ∟ jakarta. persistence .PessimisticLockException Implemented Interfaces: Serializable

jakarta.persistence.FlushModeType

Jakarta Persistence (JPA) Enum jakarta. persistence .FlushModeType java.lang.Object ∟ java.lang.Enum ∟ jakarta. persistence .FlushModeType Implemented Interfaces: Constable , Comparable , Serializable ... for the persistence context is AUTO (the default) and a flush mode setting has not been specified for the Query or

jakarta.persistence.LockTimeoutException

Jakarta Persistence (JPA) Class jakarta. persistence .LockTimeoutException java.lang.Object ∟ java.lang.Throwable ∟ java.lang.Exception ∟ java.lang.RuntimeException ∟ jakarta. persistence .PersistenceException ∟ jakarta. persistence .LockTimeoutException Implemented Interfaces: Serializable Thrown by

jakarta.persistence.Entity

Jakarta Persistence (JPA) Annotation Type jakarta. persistence .Entity Implemented Interfaces ... with no parameters, and have no final methods or persistent instance variables. An enum, record, or ... . An entity class holds state, represented as persistent fields and properties: a field or property of basic

jakarta.persistence.EntityNotFoundException

Jakarta Persistence (JPA) Class jakarta. persistence .EntityNotFoundException java.lang.Object ∟ java.lang.Throwable ∟ java.lang.Exception ∟ java.lang.RuntimeException ∟ jakarta. persistence .PersistenceException ∟ jakarta. persistence .EntityNotFoundException Implemented Interfaces: Serializable Thrown

jakarta.persistence.EntityTransaction

Jakarta Persistence (JPA) Interface jakarta. persistence .EntityTransaction Interface used ... the EntityTransaction interface. Since: Jakarta Persistence (JPA) 1.0 The JPA Connections ... a resource transaction. Throws: IllegalStateException - if isActive is true. Since: Jakarta Persistence

jakarta.persistence.EnumType

Jakarta Persistence (JPA) Enum jakarta. persistence .EnumType java.lang.Object ∟ java.lang.Enum ∟ jakarta. persistence .EnumType Implemented Interfaces: Constable , Comparable , Serializable Enumerates ... how a persistent property or field whose type is a Java enum type should be persisted . See Also: Enumerated

jakarta.persistence.PersistenceUtil

Jakarta Persistence (JPA) Interface jakarta. persistence .PersistenceUtil Utility interface between the application and the persistence provider(s). The PersistenceUtil interface instance obtained from the Persistence class is used to determine the load state of an entity or entity attribute

jakarta.persistence.ForeignKey

Jakarta Persistence (JPA) Annotation Type jakarta. persistence .ForeignKey Implemented Interfaces ... . If this annotation is not specified, a default foreign key strategy is selected by the persistence ... AssociationOverride Since: Jakarta Persistence (JPA) 2.1 Annotation Elements String name (Optional

jakarta.persistence.ManyToMany

Jakarta Persistence (JPA) Annotation Type jakarta. persistence .ManyToMany Implemented Interfaces ... ") public Set getCustomers() { return customers; } See Also: JoinTable Since: Jakarta Persistence (JPA ... using generics. Default: void/class Since: Jakarta Persistence (JPA) 1.0 CascadeType[] cascade

jakarta.persistence.ManyToOne

Jakarta Persistence (JPA) Annotation Type jakarta. persistence .ManyToOne Implemented Interfaces ... = "jobInfo.pm") Collection manages; } Since: Jakarta Persistence (JPA) 1.0 Annotation Elements Class ... of the field or property that stores the association. Default: void/class Since: Jakarta Persistence (JPA

jakarta.persistence.Embeddable

Jakarta Persistence (JPA) Annotation Type jakarta. persistence .Embeddable Implemented Interfaces ... of multiple persistent fields or properties, across several entities, and so distinct instances ... methods or persistent instance variables. An enum or interface may not be designated as

jakarta.persistence.Enumerated

Jakarta Persistence (JPA) Annotation Type jakarta. persistence .Enumerated Implemented Interfaces: Annotation Target: Method, Field Specifies that a persistent property or field should be persisted as an enumerated type. This annotation is optional if the type of a persistent field or property

jakarta.persistence.GeneratedValue

Jakarta Persistence (JPA) Annotation Type jakarta. persistence .GeneratedValue Implemented ... superclass in conjunction with the Id annotation. The persistence provider is only required ... TableGenerator SequenceGenerator Since: Jakarta Persistence (JPA) 1.0 The Auto Generated Values

jakarta.persistence.InheritanceType

Jakarta Persistence (JPA) Enum jakarta. persistence .InheritanceType java.lang.Object ∟ java.lang.Enum ∟ jakarta. persistence .InheritanceType Implemented Interfaces: Constable , Comparable ... Since: Jakarta Persistence (JPA) 1.0 Enum Constants JOINED A table for each abstract or concrete entity class

jakarta.persistence.DiscriminatorColumn

Jakarta Persistence (JPA) Annotation Type jakarta. persistence .DiscriminatorColumn Implemented ... DiscriminatorType Since: Jakarta Persistence (JPA) 1.0 Annotation Elements String name (Optional) The name of column to be used for the discriminator. Default: "DTYPE" Since: Jakarta Persistence (JPA) 1.0

Step 2: Define a JPA Entity Class

indicates that a persistence unit definition in an XML file is missing. This is discussed in the ObjectDB ... .Serializable; import javax. persistence .*; @Entity public class Point implements Serializable { private

[ODB1] Chapter 6 - Persistent Objects

Persistence objects represent data in the database. 6.1  Making Objects Persistent In JDO applications, every object in memory is either a persistent object, i.e. represents some database ... of its type. Instances of persistent classes can become persistent later, as demonstrated by