ObjectDB Database Search
101-150 of 200 resultsjakarta.persistence.EntityManager.createNamedQuery(String,Class) Jakarta Persistence (JPA) Method in jakarta.persistence.EntityManager TypedQuery createNamedQuery ( String name , Class resultClass ) Create an instance of TypedQuery for executing a Jakarta Persistence query language named query. The select list of the query must contain | |
jakarta.persistence.PersistenceUnits.classNo JavaDoc Info for jakarta.persistence.PersistenceUnits/ class | |
jakarta.persistence.criteria.CriteriaBuilder.nullLiteral(Class) Jakarta Persistence (JPA) Method in jakarta.persistence.criteria.CriteriaBuilder Expression nullLiteral ( Class resultClass ) Create an expression for a null literal with the given type. Parameters: resultClass - type of the null literal Returns: null expression literal. Since: Jakarta Persistence (JPA) 1.0 | |
jakarta.persistence.NamedNativeQuery.classes Jakarta Persistence (JPA) Method in jakarta.persistence.NamedNativeQuery ConstructorResult[] classes Specifies the result set mapping to constructors. May not be used in combination with NamedNativeQuery.resultSetMapping . Default: {} Since: Jakarta Persistence (JPA) 3.2 | |
jakarta.persistence.MapKeyJoinColumns.classNo JavaDoc Info for jakarta.persistence.MapKeyJoinColumns/ class | |
jakarta.persistence.NamedEntityGraphs.classNo JavaDoc Info for jakarta.persistence.NamedEntityGraphs/ class | |
jakarta.persistence.NamedNativeQueries.classNo JavaDoc Info for jakarta.persistence.NamedNativeQueries/ class | |
jakarta.persistence.TableGenerators.classNo JavaDoc Info for jakarta.persistence.TableGenerators/ class | |
jakarta.persistence.JoinColumns.classNo JavaDoc Info for jakarta.persistence.JoinColumns/ class | |
jakarta.persistence.SequenceGenerators.classNo JavaDoc Info for jakarta.persistence.SequenceGenerators/ class | |
jakarta.persistence.SqlResultSetMappings.classNo JavaDoc Info for jakarta.persistence.SqlResultSetMappings/ class | |
jakarta.persistence.SqlResultSetMapping.classes Jakarta Persistence (JPA) Method in jakarta.persistence.SqlResultSetMapping ConstructorResult[] classes Specifies the result set mapping to constructors. Default: {} Since: Jakarta Persistence (JPA) 2.1 | |
jakarta.persistence.EntityGraph.addTreatedSubgraph(Class) Jakarta Persistence (JPA) Method in jakarta.persistence.EntityGraph Subgraph addTreatedSubgraph ( Class type ) Add additional attributes to this entity graph that correspond to attributes of subclasses of the entity type of this EntityGraph . Subclass subgraphs automatically include | |
jakarta.persistence.EntityGraph.addSubclassSubgraph(Class) Jakarta Persistence (JPA) Method in jakarta.persistence.EntityGraph Subgraph addSubclassSubgraph ( Class type ) Add additional attributes to this entity graph that correspond to attributes of subclasses of the entity type of this EntityGraph . Subclass subgraphs automatically include | |
jakarta.persistence.Query.getParameter(String,Class) Jakarta Persistence (JPA) Method in jakarta.persistence.Query Parameter getParameter ( String name , Class type ) Get the parameter object corresponding to the declared parameter of the given name and type. This method is required to be supported for criteria queries | |
jakarta.persistence.Query.getParameter(int,Class) Jakarta Persistence (JPA) Method in jakarta.persistence.Query Parameter getParameter ( int position , Class type ) Get the parameter object corresponding to the declared positional parameter with the given position and type. This method is not required to be supported by | |
jakarta.persistence.criteria.Expression.cast(Class) Jakarta Persistence (JPA) Method in jakarta.persistence.criteria.Expression Expression cast ( Class type ) Cast this expression to the specified type, returning a new expression object. Unlike Expression.as , this method does result in a runtime type conversion. Providers are required | |
jakarta.persistence.criteria.CriteriaBuilder.function(String,Class,Expression...) Jakarta Persistence (JPA) Method in jakarta.persistence.criteria.CriteriaBuilder Expression function ( String name , Class type , Expression ... args ) Create an expression for the execution of a database function. Parameters: name - function name args | |
jakarta.persistence.criteria.CriteriaBuilder.treat(Join,Class) Jakarta Persistence (JPA) Method in jakarta.persistence.criteria.CriteriaBuilder Join treat ( Join join , Class type ) Downcast Join object to the specified type. Parameters: join - Join object type - type to be downcast to Returns: Join object of the specified type. Since: Jakarta Persistence (JPA) 2.1 | |
jakarta.persistence.criteria.CriteriaBuilder.treat(CollectionJoin,Class) Jakarta Persistence (JPA) Method in jakarta.persistence.criteria.CriteriaBuilder CollectionJoin treat ( CollectionJoin join , Class type ) Downcast CollectionJoin object to the specified type. Parameters: join - CollectionJoin object type - type to be downcast to Returns | |
JPA Persistable Types supports all JPA persistable types, which include: User-defined classes : Entity classes , mapped superclasses, and embeddable classes . Simple Java data types: Primitive types, wrapper classes , `String ... types and serializable types (user-defined or system-defined). Note : Only instances of entity classes | |
JPA Entity Fields The fields of persistable user-defined classes (entity classes , embeddable classes , and mapped ... , persistent, and inverse fields) can be used in both entity classes and embeddable classes . However, the last two groups (primary key and version fields) can be used only in entity classes . Primary key | |
SELECT clause (JPQL / Criteria API) query = em. createQuery ("SELECT c FROM Country c", Country. class ); List results = query ... c.name FROM Country AS c", String. class ); List results = query. getResultList (); You can use ... .name, c.capital.name FROM Country AS c", Object[]. class ); List results = query. getResultList | |
JPA Persistence Unit A JPA persistence unit is a logical grouping of user-defined persistable classes (entity classes , embeddable classes , and mapped superclasses) and their related settings. Defining a persistence unit ... . class ) .managedClass(sample.MyEntity2. class ); // Instantiate the EntityManagerFactory using | |
JPA Primary Key entity class . Instances of different entity classes , however, may share the same primary key value ... value by declaring a primary key field: @Entity public class Project { @Id @GeneratedValue long id ... public class Project { @Id long id; // must be initialized by the application : } An application-set | |
JPA Metamodel API about managed classes , persistent fields, and properties, similar to how Java reflection provides ... retrieve sets of types: // Get all the managed classes : // (entity classes , embeddable classes , mapped super classes ) Set allManagedTypes = metamodel. getManagedTypes (); // Get all the entity classes | |
JPA Lifecycle Events Internal callback methods are defined within an entity class . For example, the following entity class defines all supported callback methods with empty implementations: @Entity public static class ... the database (during a commit or flush operation). An entity class can define callback methods for any | |
JPA Shared (L2) Entity Cache. Per entity class , using annotations. ObjectDB Configuration The shared cache size is specified in ... except for selected entity classes (see below). DISABLE_SELECTIVE : The cache is enabled except for selected entity classes (see below). ALL (the default): The cache is enabled for all entity classes . UNSPECIFIED | |
FROM clause (JPQL / Criteria API) that iterate over all the database objects of a specific entity class hierarchy, which includes an entity class and all its descendant entity classes . Identification variables are always polymorphic (you can use type expression to exclude descendant classes from iteration). For example, in | |
Retrieving JPA Entities the no-argument constructors of entity classes and keep them as simple as possible. Retrieval by class and primary key Every entity can be uniquely identified and retrieved by the combination of its class ... object with a primary key of 1: Employee employee = em. find (Employee. class , 1); You do not need | |
JPA Named Queries methods. Each @NamedQuery annotation is attached to exactly one entity class or mapped superclass, usually ... a prefix. For example, you can add the preceding @NamedQuery to the Country entity class : @Entity @NamedQuery ( name ="Country.findAll", query ="SELECT c FROM Country c") public class Country | |
Paths and Types in JPQL and Criteria API Instances of user-defined persistent classes (entity classes , mapped superclasses, and embeddable classes ) are represented in JPQL by the following types of expressions: Variables : FROM identification variables and SELECT result variables. Parameters : Instances of these classes that are assigned | |
Schema Update The configuration element supports renaming packages, classes , and fields in ObjectDB databases ... when you rename or move persistable classes to another package. If you run the application with persistable classes that have been renamed or moved in the IDE without a matching schema configuration, ObjectDB | |
Index Definition class EntityWithSimpleIndex { @Index String indexedField1; @Index ( unique ="true") int indexedField2 ... , long , float , double Equivalent wrapper classes from the java.lang package: Byte , Short , Character ... ={"lastName","firstName"}) public class EntityWithCompositeIndex { String firstName; String | |
JPA Components Annotations You can use Jakarta Persistence (JPA) annotations to mark classes as persistent and to configure ... class : Marks the class as an entity. Entities are persistent domain objects with a unique identity (primary key) and their own lifecycle. Marks the class as embeddable. Instances are stored as | |
Database Explorer (entity and embeddable classes ) in the database and their persistent fields and indexes. The Query ... , either write a query in the Query window or select an element to view (such as an entity class in the Schema ... the Edit New Entities... command. In the dialog box, select the entity class and specify the number | |
Database Schema Evolution Modifications to entity classes that do not change their persistent field definitions ... to the persistent fields of an entity class . New entities must be stored using the new class schema, and old entities, which were stored using the old class schema, must be converted to the new schema. Note | |
Storing JPA Entities code stores an Employee entity class instance in the database: Employee employee = new Employee ... class instance. Only entity class instances can be stored in the database independently. Objects ... of persistable types other than entity classes are automatically stored as embedded objects in | |
Entity Management Settings attribute specifies how non-enhanced classes are handled. ObjectDB can manage non-enhanced classes by ... represent different policies: "error" - All persistable classes must be enhanced; otherwise, ObjectDB throws an exception. "warning" - ObjectDB logs a warning for every non-enhanced class . "ignore | |
Posting Sample Code. Whenever possible: Use a single Java file with one main class + static inner classes for entity / embeddable classes . Avoid dependency on external libraries . Use a console application with a main ... test; import java.util.*; import jakarta.persistence.*; public final class MyTestCase {   | |
ObjectDB Object Database Features). Up to 2,147,483,648 entity classes per database file. Up to 2,147,483,648 indices per database file ... versioning. Class hierarchy changes are handled automatically. New added fields are handled ... . Moving fields up and down in the class hierarchy is transparent. Support for renaming types, fields | |
Literals in JPQL and Criteria Queries literals represent entity types in JPQL, similar to how java.lang. Class instances represent Java ... literal is the name of the entity class (for example, Country ). This is equivalent to Country. class in Java code. The name of the entity class is not enclosed in quotation marks because type literals | |
Auto Generated Values with @GeneratedValue and use the AUTO strategy: @Entity public class EntityWithAutoId1 { @Id @GeneratedValue ... definition is equivalent: @Entity public class EntityWithAutoId2 { @Id @GeneratedValue long id ... is very similar to the AUTO strategy: @Entity public class EntityWithIdentityId { @Id @GeneratedValue | |
Date and Time in JPQL and Criteria Queries expressions that extract date parts: Expression year = cb. function ("year", Integer. class , date); Expression month = cb. function ("month", Integer. class , date); Expression day = cb. function ("day", Integer. class , ts); // Create expressions that extract time parts: Expression hour = cb. function ("hour | |
JPA Query Structure (JPQL / Criteria) operates on Java classes and objects. For example, a JPQL query can retrieve entities, unlike SQL ... ). The exceptions, where JPQL is case-sensitive, include Java source elements such as the names of entity classes ... to an entity class is called a range variable. Range variables define an iteration over all the database | |
JPA Core Types engine and performing CRUD operations in ObjectDB. These interfaces and classes manage the entity ... illustrates the core JPA classes , interfaces, and enums, including their dependencies ... Initialize the persistence context and configure the engine using these classes : The primary bootstrap class | |
Step 3: Define an EJB Session Bean Operations on the database will be performed by an instance of a session bean (EJB) class that we will define in this step: Open the [New Java Class ] dialog box by right clicking the guest package node (in the [Package Explorer] window) and selecting New Class . The package name should be guest | |
Step 3: Define an EJB Session Bean Operations on the database will be performed by an instance of a session bean (EJB) class ... Bean and clicking Next . Enter GuestDao as the EJB class name - use exactly that case sensitive class ... ) class . Now replace the content of the new source file with the following code: package guest; import | |
Step 3: Define a Spring DAO Component) that we will define in this step as a Spring MVC component: Open the [New Java Class ] dialog box by right ... Java Class ... . Enter GuestDao as the class name - use exactly that case sensitive class name. The Package should be guest. Click Finish to create the new DAO Spring component class . Now | |
Step 3: Define a Spring DAO Component) that we will define in this step as a Spring MVC component: Open the [New Java Class ] dialog box by right clicking the guest package node (in the [Package Explorer] window) and selecting New Class . The package name should be guest . Enter GuestDao as the class name - use exactly |