Internal Website 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 . | |
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 | |
[ODB1] Chapter 3 - Persistent Classes Persistent Classes are user defined classes whose instances can be stored in a database using JDO. Instances of these classes that represent objects in the database are called persistent objects or ... of persistent classes that live only in memory) are called transient objects or transient instances | |
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 | |
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 | |
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 | |
javax.persistence.InheritanceType.TABLE_PER_CLASS JPA Enum Constant in javax.persistence.InheritanceType TABLE_PER_ CLASS A table per concrete entity class . Since: JPA 1.0 | |
javax.persistence.SqlResultSetMapping.classes JPA Annotation Attribute in javax.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 | |
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 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 | |
[ODB1] Chapter 4 - JDO Metadata more persistent classes . All the persistent classes , and only them, have to be declared in a metadata ... system. Therefore, at deployment, .jdo metadata files must be packaged with an application's . class files ... at runtime, ObjectDB determines whether or not each class is persistent. It searches for JDO metadata | |
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 | |
[ODB1] Chapter 7 - JDOQL Queries . An Extent , for instance, can be used to retrieve all the instances of a specified persistent class ... three components: A candidate collection containing persistent objects (usually an Extent ) A candidate class (usually a persistent class ) A filter, which is a boolean expression in a Java like syntax The query | |
[ODB1] Chapter 2 - A Quick Tour of a single source file, HelloWorld.java , containing a single class : 1 // A simple program that manages ... .objectdb.Utilities; 6 7 public class HelloWorld { 8 9 public static void main(String[] args) { 10 11 ... , including exceptions. ObjectDB Extensions The com.objectdb.Utilities class implements | |
[ODB1] Chapter 9 - ObjectDB Explorer is open. The " Class " window shows all the persistent classes in the database. You can select a class from the list of classes at the top of this window and see all its persistent fields ... viewer window, first select a target element: Select a persistent class in the " Class " tabbed window | |
[ODB1] Chapter 6 - Persistent Objects object, regardless of its type. Instances of persistent classes can become persistent later, as ... is also thrown if the argument to makePersistent( ... ) is not an instance of a persistent class (as defined in ... of makePersistent( ... ) to instances of user defined persistent classes . However, persistence by | |
PersistenceManagerFactory.addInstanceLifecycleListener(listener,classes) - JDO Method; InstanceLifecycleListener listener, Class [] classes ) Add ... is called). The classes parameter identifies all of the classes of interest. If the classes parameter is specified as null , events for all persistent classes and interfaces will be sent | |
PersistenceManager.addInstanceLifecycleListener(listener,classes) - JDO Method; InstanceLifecycleListener listener, Class ... classes ) Adds the listener instance to the list of lifecycle event listeners. The classes parameter identifies all of the classes of interest. If the classes parameter is specified as null , events for all persistent classes | |
PersistenceManager.getManagedObjects(states,classes) - JDO Method;states, Class ... classes ) Get the objects managed by this persistence manager having the specified object states and being instances of the specified classes . Parameters: states - The states of objects that we are interested in classes - The classes of objects that we are interested in Return: the objects Since: JDO 2.1 | |
PersistenceManager.getManagedObjects(classes) - JDO Method JDO Method in javax.jdo.PersistenceManager Set getManagedObjects ( Class ... classes ) Get the objects managed by this persistence manager being instances of the specified classes . Parameters: classes - The classes of objects that we are interested in Return: the objects Since: JDO 2.1 | |
javax.jdo.annotations.DiscriminatorStrategy.CLASS_NAME JDO Enum Constant in javax.jdo.annotations.DiscriminatorStrategy CLASS _NAME Since: JDO 2.1 |