ObjectDB ObjectDB

Internal Website Search

121-130 of 200 resultsRefresh

JPA Criteria API Queries

Criteria Query The following query string represents a minimal JPQL query: SELECT c FROM Country c ... > c = q.from(Country.class); q.select(c); The CriteriaBuilder interface serves as the main ... the built query. Then a Root instance is created to define a range variable in the FROM clause. Finally

Deleting JPA Entity Objects

Existing entity objects can be deleted from the database either explicitly by invoking the remove ... from the database it has to first be retrieved (no matter which way) and then in an active ... (); The entity object is physically deleted from the database when the transaction is committed. Embedded

Updating JPA Entity Objects

Once an entity object is retrieved from the database (no matter which way) it can simply be modified in memory from inside an active transaction: Employee employee = em.find(Employee.class, 1); em ... can be cascaded from all the entity objects that have to be stored in the database, including from

Running JPA Queries

: TypedQuery<Country> query = em.createQuery("SELECT c FROM Country c", Country.class); List ... (generic) type: Query query = em.createQuery("SELECT c FROM Country c"); List results = query ... has to be extracted from the result collection after query execution (e.g. by results.get(0)). To eliminate

JPA Primary Key

that is absent from other object oriented databases. Entity Identification Every entity object in the database is uniquely identified (and can be retrieved from the database) by the combination of its type ... are deleted from the database. The primary key value of an entity can be accessed by declaring a primary

Shared (L2) Entity Cache

an entity object that is already managed by the EntityManager returns the existing instance from ... - every entity class which is not marked with @Cacheable inherits cacheability setting from its super ... context. If an entity object is not available also in the shared cache - it is retrieved from

Step 3: Add a Main Class

to store Point objects in the database and then retrieve them from the database. Use copy and paste ... : Query q1 = em.createQuery("SELECT COUNT(p) FROM Point p"); System.out.println("Total Points ... .createQuery("SELECT AVG(p.x) FROM Point p"); System.out.println("Average X: " + q2.getSingleResult

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 ... ("SELECT COUNT(p) FROM Point p"); System.out.println("Total Points: " + q1.getSingleResult()); // Find the average X value: Query q2 = em.createQuery("SELECT AVG(p.x) FROM Point


to manage the life cycle of PersistenceCapable instances. A PersistenceManager is obtained from ... .0 void deletePersistent(Object pc) Delete the persistent instance from the data store. Delete the persistent instance from the data store. This method must be called in an active transaction

[ODB1] Chapter 4 - JDO Metadata

from classes B and C are stored. The closest persistent super class in the inheritance hierarchy ... . When a persistent object is retrieved from the database its fields are not ready yet. Only when the program accesses a field is the field value loaded automatically by ObjectDB from the database. If the field

Getting Started

ObjectDB is very easy to use. Follow the Getting Started Tutorial and the Quick Tour manual chapter and in minutes you may be able to write and run first Java programs against ObjectDB.

Prior knowledge or experience in database programming (SQL, JDBC, ORM, JPA, etc.) is not required, but some background in using the Java language is essential.

Need Help?

  1. Search ObjectDB website
  2. Read the FAQ
  3. Follow the Tutorials
  4. View or post in the forum
  5. Search or file an issue
  6. Contact support