ObjectDB Database Search
1-50 of 200 resultsJPA Class Enhancer of compiled classes after compilation. Enhancement is mainly for user-defined persistable classes ( entity classes , embeddable classes and mapped superclasses ), and is usually optional. There is one case, however, where enhancement is required. Non persistable classes that access directly (not | |
Defining a JPA Entity Class To be able to store Point objects in the database using JPA we need to define an entity class . A JPA entity class is a POJO (Plain Old Java Object) class , i.e. an ordinary Java class ... this is similar to serializable classes , which are marked as having the ability to be serialized. The Point | |
JPA Annotations for Classes JPA defines three types of persistable classes which are set by the following annotations: Chapter 2 of the ObjectDB manual explains these annotations in detail. Entity and mapped super classes ... policy (as explained in chapter 3 ): Another JPA class annotation defines an ID class : ID classes | |
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 . This chapter contains the following sections: | |
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 Java Class ] dialog box, e.g. by right clicking the tutorial package node (in the [Projects] window) and selecting New Java Class ... Enter Point as the class name - use exactly that case sensitive | |
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 Java Class ] dialog box, e.g. by right clicking the project node (in the [Projects] window) and selecting New Java Class ... Enter Guest as the class name - use exactly that case sensitive class name | |
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 Java Class ] dialog box, e.g. by right clicking the project node (in the [Package Explorer] window) and selecting New Class . Enter guest as the package name - use exactly that case sensitive package | |
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 on the project in the [Package Explorer] window and select New Class . Enter tutorial as the package name (case sensitive). Enter Point as the class name (case sensitive). Click Finish to create | |
Step 2: Entity Class and Persistence Unit To store objects in an ObjectDB database using JPA we need to define an entity class : Right click ... , enter src/main/java as Folder Name and click Finish . Open the [New Java Class ] dialog box, e.g. by ... ; New Class . Enter guest as the package name - use exactly that case sensitive package | |
Step 2: Entity Class and Persistence Unit To store objects in an ObjectDB database using JPA we need to define an entity class : Open the [New Entity Class ] dialog box, e.g. by right clicking the project node (in the [Projects] window) and selecting New Entity Class ... (or New Other... Persistence Entity Class and clicking | |
Step 2: Entity Class and Persistence Unit To store objects in an ObjectDB database using JPA we need to define an entity class : Open the [New Java Class ] dialog box, e.g. by right clicking the project node (in the [Package Explorer] window) and selecting New Class . Enter guest as the package name - use exactly that case | |
Step 2: Entity Class and Persistence Unit To store objects in an ObjectDB database using JPA we need to define an entity class : Open the [New Entity Class ] dialog box, e.g. by right clicking the project node (in the [Projects] window) and selecting New Entity Class ... (or New Other... Persistence Entity Class and clicking Next ). Enter | |
Step 4: Add a Controller Class 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 GuestController as the class name - use exactly that case sensitive class name. Click Finish to create | |
Step 4: Add a Controller Class Class ] dialog box by right clicking the guest package node (in the [Projects] window) and selecting New Java Class ... Enter GuestController as the class name - use exactly that case sensitive class name. The Package should be guest. Click Finish to create the new Spring Controller class . Now | |
Step 3: Add a Context Listener Class as the class name - use exactly that case sensitive class name. Click Next and then Select All to enable the Finish button. Click Finish to create the new listener class . Now replace the content ... .servlet.*; @WebListener public class GuestListener implements ServletContextListener { // Prepare | |
Step 3: Add a Main Class In this step we will add a main class to the project to store and retrieve Point objects from the database: Right click the tutorial package in the [Package Explorer] window and select New Class . The package name should be tutorial . Enter Main as the class name (case sensitive). Click Finish | |
Step 3: Add a Context Listener Class Other... Select Web Web Application Listener and click Next . Enter GuestListener as the class name - use exactly that case sensitive class name. The Java package name should be guest. Click Finish to create the new listener class . Now replace the content of the new source file with the following | |
Step 4: Add a Servlet Class. Enter GuestServlet as the class name - use exactly that case sensitive class name. Click Finish to create the new servlet class . Now replace the content of the new source file with the following code ... ; import javax.servlet.http.*; import javax.persistence.*; @WebServlet("/GuestServlet") public class | |
Step 4: Add a Servlet Class ... Enter GuestServlet as the class name - use exactly that case sensitive class name. The Java package name should be guest. Click Finish to create the new servlet class . Now replace the content ... .persistence.*; @WebServlet("/GuestServlet") public class GuestServlet extends HttpServlet { private static | |
Step 4: Add a Servlet Class ... Enter GuestServlet as the class name - use exactly that case sensitive class name. The Java package name should be guest. Click Finish to create the new servlet class . Now replace the content ... .http.HttpServletResponse; @WebServlet(name="GuestServlet", urlPatterns={"/guest"}) public class | |
Step 4: Add a Servlet Class GuestServlet as the class name - use exactly that case sensitive class name. Click Finish to create the new servlet class . Now replace the content of the new source file with the following code: package ... ="GuestServlet", urlPatterns={"/guest"}) public class GuestServlet extends HttpServlet { private static final | |
Step 3: Add a Main Class In this step we will add code to the Main class (that was generated with the project) in order ... to replace the content of the Main class with the following content: package tutorial; import javax.persistence.*; import java.util.*; public class Main { public static void main(String[] args) { // Open | |
JPA Persistable Types. ObjectDB supports all the JPA persistable types, which are: User defined classes - Entity classes , Mapped superclasses, Embeddable classes . Simple Java data types: Primitive types, Wrappers, String ... types and Serializable types (user or system defined). Note : Only instances of entity classes | |
JPA Lifecycle Events methods are methods that are defined within an entity class . For example, the following entity class defines all the supported callback methods with empty implementations: @Entity public static class ... - after deleting an entity from the database (during commit or flush ). An entity class may include callback | |
JPA Entity Fields 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 only be used in entity classes . Primary key fields | |
EnumConstRef jakarta.persistence.InheritanceType.TABLE_PER_CLASS JPA Enum Constant in jakarta.persistence.InheritanceType TABLE_PER_ CLASS A table for each concrete entity class . Each concrete class in the hierarchy has its own table, and each entity instance is stored as a single table row. No discriminator column is necessary. Since: JPA 1.0 | |
AnnotationAttrRef jakarta.persistence.NamedNativeQuery.classes JPA Annotation Attribute in jakarta.persistence.NamedNativeQuery ConstructorResult [] classes default {} Specifies the result set mapping to constructors. May not be used in combination with resultSetMapping . Since: JPA 3.2 | |
AnnotationAttrRef jakarta.persistence.SqlResultSetMapping.classes JPA Annotation Attribute in jakarta.persistence.SqlResultSetMapping ConstructorResult [] classes default {} Specifies the result set mapping to constructors. Since: JPA 2.1 | |
JDO Predefined ID Classes An object ID is a combination of a persistence capable class and a primary key. It provides a unique representation of a persistent object. The following classes serve as predefined ID classes for persistence capable classes with a simple single field primary key: Object IDs are used in many | |
SELECT clause (JPQL / Criteria API) = em. createQuery ("SELECT c FROM Country c", Country. class ); List results = query. getResultList ... c.name FROM Country AS c", String. class ); List results = query. getResultList (); Only singular ... .name FROM Country AS c", Object[]. class ); List results = query. getResultList (); for (Object[] result | |
JDO Annotations for Classes JDO supports two modes of persistable classes that can be set by the following annotations: Non persistable classes that should be enhanced (because of accessing persistent fields of other classes directly) can be marked with: The identity mode of persistence capable classes can be specified by using: | |
JPA Primary Key and its primary key. Primary key values are unique per entity class . Instances of different entity classes , however, may share the same primary key value. Only entity objects have primary keys ... a primary key field: @Entity public class Project { @Id @GeneratedValue long id; // still set | |
JPA Metamodel API details on managed classes and persistent fields and properties, similarly to the ability ... . Three methods can be used to retrieve sets of types: // Get all the managed classes : // (entity classes , embeddable classes , mapped super classes ) Set allManagedTypes = metamodel. getManagedTypes | |
JPA Persistence Unit 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 ... specify JAR files that should be searched for managed persistable classes . The class elements | |
Shared (L2) Entity Cache class - using annotations. ObjectDB Configuration The shared cache size is specified in the ObjectDB ... except for selected entity classes (see below). DISABLE_SELECTIVE - cache is enabled except for selected entity classes (see below). ALL (the default) - cache is enabled for all the entity classes | |
FROM clause (JPQL / Criteria API) class hierarchy (i.e. an entity class and all its descendant entity classes ). Identification variables are always polymorphic. JPQL does not provide a way to exclude descendant classes from iteration ... of an entity class in a JPQL query is the unqualified name of the class (e.g. just Country with no package | |
JPA Named Queries to exactly one entity class or mapped superclass - usually to the most relevant entity class ... the above @NamedQuery to the Country entity class : @Entity @NamedQuery ( name ="Country.findAll", query ="SELECT c FROM Country c") public class Country { ... } Attaching multiple named queries | |
Paths and Types in JPQL and Criteria API Instances of user defined persistable classes (entity classes , mapped super classes and embeddable classes ) are represented in JPQL by the following types of expressions: Variables - FROM identification variables and SELECT result variables. Parameters - when instances of these classes | |
Retrieving JPA Entity Objects of entity classes and to keep them as simple as possible. Retrieval by Class and Primary Key Every entity object can be uniquely identified and retrieved by the combination of its class and its primary key ... object whose primary key is 1: Employee employee = em. find (Employee. class , 1); Casting | |
Schema Update The configuration element supports renaming packages, classes and fields in ObjectDB databases as ... when persistable classes are renamed or moved to another package. Running the application with persistable classes that have been renamed or moved in the IDE, with no matching schema configuration | |
Index Definition; @Entity public class EntityWithSimpleIndex { @Index String indexedField1; @Index ( unique ="true") int ... classes from package java.lang: Byte , Short , Character , Integer , Long , Float , Double. java.math ... of the @Index or @Unique annotations: @Entity @Index ( members ={"lastName","firstName"}) public class | |
Database Explorer and embeddable classes ) in the database and their persistent fields and indexes. The [Query] window enables ... ] tabbed window or select an element for viewing (an entity class in the [Schema] tabbed window ... New Entity Objects... 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 ... of an entity class are detected by ObjectDB. New entity objects have to be stored in the new class schema, and old entity objects, which were stored previously in the old class schema | |
Entity Management Settings, supported only on selected JVMs. The reflection attribute specifies how non enhanced classes are handled. ObjectDB can manage non enhanced classes by using reflection at the cost of performance ... classes must be enhanced - otherwise an exception is thrown. "warning" - a warning is logged | |
Storing JPA Entity Objects an instance of the Employee entity class in the database: Employee employee = new Employee("Samuel ... class . Only instances of entity classes can be stored in the database independently. Objects ... (); Instances of persistable types other than entity classes are automatically stored embedded in | |
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 javax.persistence.*; public final class MyTestCase {   | |
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 |