Internal Website Search
51-100 of 200 resultsInsert a new entity class in a class hierarchy does not work Hello, we have an entity class hierarchy and we want to insert a new entity in this hierarchy ... , because the class hierarchy had already always existed and the "new" entity class needed ... would be also inserted new in the class hierarchy then it works well. See our example in the attachments. Execute | |
Using your own classes in the entity class?Using your own classes in the entity class? | |
Dependency from enhanced classes to the objectDB library Hello, we have a Question to the dependency from enhanced classes (required for license ... enhanced classes . We have an ANT script in “com.btc.ep.base.dal.impl” to enhance the classes . The log ... .dal.impl, as Ant Build. - This should enhance three classes . 4) The run | |
objectdb-2.6.9_02 (with "objectdb.temp.no-enhancement-crc-check") vs. generic classes with interfaces: detailed investigation when using with generic classes for "deep" value wrappers with signatures like: @Entity abstract public class Value extends [SomeOtherEntity] implements IValue { @Entity public class BooleanValue extends Value implements IBooleanValue { @Entity public class IntegerValue extends Value ... { @Entity abstract | |
Schema Update: class hierarchy change Hello, we try to change the class hierarchy of an Entity. You wrote www.objectdb.com/database/forum/899 that ObjectDB support automatic schema evolution for adding and removing fields and for class ... .EntityManagerFactory; import javax.persistence.Persistence; public final class Test { public static void main(String | |
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 ... 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 {   | |
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 ... and type versioning. Class hierarchy changes are handled automatically. New added fields ... automatically. Moving fields up and down in the class hierarchy is transparent. Support for renaming | |
Auto Generated Values @GeneratedValue with the AUTO strategy: @Entity public class EntityWithAutoId1 { @Id @GeneratedValue ... definition is equivalent: @Entity public class EntityWithAutoId2 { @Id @GeneratedValue long id ... to the AUTO strategy: @Entity public class EntityWithIdentityId { @Id @GeneratedValue ( strategy | |
Literals in JPQL and Criteria Queries.lang. Class instances in Java represent Java types. Entity type literals have been added in JPA 2 ... of the entity class (e.g. Country). That is equivalent to Country. class in Java code. Notice that the name of the entity class is not enclosed in quotes (because type literals are not string literals). By | |
Detached Entity Objects field): @Entity class Employee { : @OneToOne ( cascade = CascadeType . DETACH ) private Address address; : } In the example above, the Employee entity class contains an address field that references an instance of Address , which is another entity class . Due to the CascadeType.DETACH setting | |
Deleting JPA Entity Objects transaction, it can be deleted using the remove method: Employee employee = em. find (Employee. class , 1 ... is not an instance of an entity class or if it is a detached entity. A TransactionRequiredException ... can be referenced by a collection field): @Entity class Employee { : @OneToOne ( cascade | |
Date and Time in JPQL and Criteria Queries. 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", Integer. class , time); Expression minute | |
JPA Query Structure (JPQL / Criteria) classes and objects. For example, a JPQL query can retrieve and return entity objects ... elements such as names of entity classes and persistent fields, which are case sensitive. In addition ... over objects in the database. A query variable that is bound to an entity class is referred to as a range | |
JPA Criteria API Queries: CriteriaBuilder cb = em. getCriteriaBuilder (); CriteriaQuery q = cb. createQuery (Country. class ); Root c = q. from (Country. class ); q. select (c); The CriteriaBuilder interface serves as the main ... ", Country. class ); List results = query. getResultList (); Because eventually both types of queries | |
Database Management Settings some ORM JPA providers) is defined in the entity class or not. It can be disabled by setting the  ... indexes are handled. When a new index is defined for an existing entity class that already has instances ... Removing ObjectDB evaluation restrictions (of 10 entity classes and 1,000,000 entity objects | |
Updating JPA Entity Objects from inside an active transaction: Employee employee = em. find (Employee. class , 1); em ... chapter 5. However, detecting changes to arrays requires using snapshots even if the entity classes ... changes when using enhanced entity classes : Employee employee = em. find (Employee. class , 1); em | |
WHERE clause (JPQL / Criteria API) that index to iterate directly on Country objects that satisfy the WHERE predicate. For entity classes ... can be built by using the criteria query API as follows: CriteriaQuery q = cb. createQuery (Country. class ); Root c = q. from (Country. class ); q. select (c); ParameterExpression p = cb. parameter (Integer | |
JPA Query API. createQuery ("SELECT c FROM Country c", Country. class ); In the above code, the same JPQL query ... yet and the Country class is unknown as a managed entity class - only the TypedQuery variant is valid because it introduces the Country class to ObjectDB. Dynamic JPQL, Criteria API | |
Query Parameters in JPA Country c WHERE c.name = :name", Country. class ); return query. setParameter ("name", name ... WHERE c.name = ?1", Country. class ); return query. setParameter (1, name). getSingleResult ... WHERE c.name = '" + name + "'", Country. class ); return query. getSingleResult (); } Instead of using | |
Database Connection using JPA defines classes that implement these interfaces. When you use ObjectDB you work with instances of ObjectDB classes that implement these interfaces, and because standard JPA interfaces are used ... a static factory method of the JPA bootstrap class , Persistence : EntityManagerFactory emf | |
Comparison in JPQL and Criteria API defined classes (entity classes and embeddable classes ) can be compared by using the equality operators | |
Locking in JPA (which is required by some ORM JPA providers) is defined in the entity class or not. Pessimistic Locking The main ... ( Employee. class , 1, LockModeType . PESSIMISTIC_WRITE ); Similarly, the refresh method ... ( Employee. class , 1, LockModeType . PESSIMISTIC_WRITE , properties | |
JPA Exceptions.TransactionRequiredException Exception Class Overview The root of the JPA exception class subtree is: General errors are represented directly by the PersistenceException class . Some specific errors are represented by | |
Schema-Update: Deactivation of automatic entity class removing and introduction of a new class remove in the schema config works correctly we add ALL entity classes to this product. Because we will prevent a data loss of entites which are not found in the class path. With this background it would be very helpful for us if we could ignore in the ProfileMigration the classes we had not changed. And we were able | |
Strings in JPQL and Criteria Queries' . The matches method of the String class can be useful when there is a need for pattern matching using regular ... = country. get ("name"); Expression param = cb. parameter (String. class ); // str [NOT] LIKE pattern | |
What is the Java Persistence API (JPA)?) is that in JPA data is represented by classes and objects rather than by tables and records as in ... (as classes and objects). ObjectDB is the only database management system with built in support | |
DELETE Queries in JPA/JPQL of a specified entity class (including instances of subclasses) from the database. For example ... the java.lang.Object class in queries (as an extension to JPA), so the following query | |
JPA Metamodel API The JPA Metamodel API, which is introduced in JPA 2.0, enables examining the classes , fields and properties of the persistent object model, similarly to the Java reflection API. The main interface of the JPA Metamodel API is: Types (mainly classes ) and attributes (persistent field and properties | |
Running JPA Queries: TypedQuery query = em. createQuery ("SELECT c FROM Country c", Country. class ); List results = query ... COUNT(c) FROM Country c", Long. class ); long countryCount = query. getSingleResult (); Notice | |
JPA Annotations JPA defines dozens of annotations that can be divided into the following groups: Annotations for JPA aware classes : Annotations for fields in JPA persistable classes : Annotations for additional JPA configuration: Annotations for JPA lifecycle event callbacks: Java EE container annotations: Many | |
GROUP BY and HAVING clauses using the criteria query API as follows: CriteriaQuery q = cb. createQuery (Country. class ); Root c = q. from (Country. class ); q. multiselect (c. get ("currency"), cb. sum (c. get ("population"))); q | |
ORDER BY clause (JPQL / Criteria API) can be built using the criteria query API as follows: CriteriaQuery q = cb. createQuery (Country. class ); Root c = q. from (Country. class ); q. select (c); q. orderBy (cb. asc (c. get ("currency")), cb. desc | |
Working with JPA Entity Objects Entity objects are in-memory instances of entity classes (persistable user defined classes ), which can represent physical objects in the database. Managing an ObjectDB Object Database using JPA requires using entity objects for many operations, including storing, retrieving, updating and deleting | |
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 | |
Step 1: Create a Java Project ). The name of the Main class should be tutorial.Main . Verify that exactly this case sensitive fully qualified class name is set (you may use copy & paste). Click the Finish button to create ... with ObjectDB/JPA support. The next step is creating a JPA Entity class . | |
Step 1: Create a Maven Web Project.2 enhance process- classes java com.objectdb.Enhancer guest.Guest org.mortbay.jetty maven-jetty ... Framework and ObjectDB/JPA support. The next step is creating a JPA Entity class . | |
Step 1: Create a Maven Web Project- classes java   ... MVC Framework and ObjectDB/JPA support. The next step is creating a JPA Entity class . | |
[ODB1] Chapter 5 - JDO Connections, not as classes . Every JDO implementation, including ObjectDB, defines classes that implement these interfaces. When using ObjectDB you are actually working with instances of ObjectDB classes ... .objectdb.jdo.PMF" (the name of ObjectDB's class that implements the PersistenceManagerFactory interface | |
[ODB1] Chapter 1 - About ObjectDB with tables, records and SQL in addition to the application's classes and objects. ObjectDB is JDO ... . Most other JDO implementations map classes and objects to tables and records in an RDBMS. Using ... on the application's Java classes exclusively. ObjectDB is Very Portable ObjectDB is written entirely | |
ObjectDB 1.0 Manual on programming with ObjectDB and JDO: Chapter 3 - Persistent Classes Explains what a persistence capable class is and which types are supported by JDO. Chapter 4 - JDO Metadata Shows how to define JDO metadata for persistence capable classes . Chapter 5 - JDO Connections Shows how to use database connections | |
JDO External Listeners The following types can be used to implement external listener classes for JDO lifecycle events: Listener objects can be bound to one or more persistence capable classes by invoking the addInstanceLifecycleListner method either at the PersistenceManagerFactory level or the PersistenceManager level. | |
javax.jdo.spi.JDOImplHelper JDO Class JDOImplHelper java.lang.Object ∟ javax.jdo.spi.JDOImplHelper This class is a helper class for JDO implementations. It contains methods to register metadata for persistence-capable classes and to perform common operations needed by implementations, not by end users. JDOImplHelper |