ObjectDB Database Search

1-50 of 200 results

Retrieving JPA Entity Objects

The Java Persistence API (JPA) provides various ways to retrieve objects from the database. The retrieval of objects does not require an active transaction because it does not change the content of the database. The persistence context serves as a cache of retrieved entity objects . If a requested

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

Detached Entity Objects

Detached entity objects are objects in a special state in which they are not managed by any EntityManager but still represent objects in the database. Compared to managed entity objects , detached objects are limited in functionality: Many JPA methods do not accept detached objects (e.g. lock

Storing JPA Entity Objects

New entity objects can be stored in the database either explicitly by invoking the persist method ... (). commit (); The Employee instance is constructed as an ordinary Java object and its initial state is New. An explicit call to persist associates the object with an owner EntityManager em and changes

Deleting JPA Entity Objects

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

ObjectDB Object Database Features

, derived attributes, grouping queries and aggregate queries) which are usually missing from Object Oriented Databases are also supported by ObjectDB. The combination of Object Database features ... . Up to 9,223,372,036,854,775,808 entity objects per database file. Unlimited database connections

Updating JPA Entity Objects

Modifying existing entity objects that are stored in the database is based on transparent ... Once an entity object is retrieved from the database (no matter which way) it can simply be modified in memory ... (); The entity object is physically updated in the database when the transaction is committed

ObjectDB - JPA Object Database for Java

solution. Using a relational database management system (RDBMS) to store and retrieve Java objects requires slow conversions between graphs of Java objects and flat database table rows. Object Relational ... , and even add their own overhead. ObjectDB supports direct storage of graphs of objects

Is ObjectDB better than competing object databases?

. However, you should consider the following points when doing your own objective comparison of object databases: ObjectDB is unique in supporting the standard APIs. It is the only object database with built in ... of the Java Data Objects (JDO) API than competing object databases. By using a standard API such as JPA

Is ObjectDB better than Object Relational Mapping (ORM)?

All about Is ObjectDB better than Object Relational Mapping (ORM)? in Java/JPA database - explanations, examples, references, links and related information.

Database Explorer

of bookmarked entity objects . The [Schema] window shows the user defined persistable types (entity ... a single object , every column represents a persistent field, and the content of a cell is the value of a single field in a single database object . This type of viewer is useful for viewing data

SELECT clause (JPQL / Criteria API)

The ability to retrieve managed entity objects is a major advantage of JPQL. For example, the following query returns Country objects that become managed by the EntityManager em : TypedQuery query ... (); Because the results are managed entity objects they have all the support that JPA provides

JPA Primary Key

Every entity object that is stored in the database has a primary key. Once assigned, the primary key cannot be modified. It represents the entity object as long as it exists in the database. As an object database, ObjectDB supports implicit object IDs, so an explicitly defined primary key is not

Locking in JPA

in ObjectDB (and in JPA) is always at the database object level, i.e. each database object is locked separately. Optimistic locking is applied on transaction commit. Any database object ... is being performed on an old version of a database object , for which another update has already been committed

What is the Java Data Objects (JDO)?

The Java Data Objects (JDO) is another standard for accessing persistent data in databases, using plain old Java objects (POJO) to represent the object model. Unlike Java Persistence API (JPA ... with both relational and object databases. JDO is supported by many object databases, including ObjectDB

FROM clause (JPQL / Criteria API)

The FROM clause declares query identification variables that represent iteration over objects in ... a program, since both are used for iteration over objects . Range Variables Range variables are query identification variables that iterate over all the database objects of a specific entity

GROUP BY and HAVING clauses

properties of generated groups instead of individual objects and fields. The position of a GROUP BY ... clause. When a GROUP BY clause exists in a JPQL query, database objects (or tuples of database objects ... over all the Country objects in the database. The GROUP BY clause groups these Country objects by

Running JPA Queries

- for use when exactly one result object is expected. Query.getResultList - for general use in any ... .getSingleResult - for use when exactly one result object is expected. TypedQuery.getResultList ... Query Execution (with getResultList) The following query retrieves all the Country objects in

Shared (L2) Entity Cache

Every EntityManager owns a persistence context , which is a collection of all the entity objects ... an entity object that is already managed by the  EntityManager returns the existing instance from the persistence context, rather than a newly instantiated entity object . The scope of the persistence

Paths and Types in JPQL and Criteria API

are assigned as arguments. Path expressions that navigate from one object to another. Instances of user ... expression) and uses the dot ( . ) operator to navigate through persistent fields to other objects and values. For example - c.capital , where c represents a Country entity object uses the capital

JPA Entity Fields

the @Transient annotation). Storing an entity object in the database does not store methods or code. Only the persistent state of the entity object , as reflected by its persistent fields (including persistent fields that are inherited from ancestor classes), is stored. When an entity object is stored in

DELETE Queries in JPA/JPQL

As explained in chapter 2 , entity objects can be deleted from the database by: Retrieving the entity objects into an EntityManager . Removing these objects from the EntityManager   ... DELETE queries provide an alternative way for deleting entity objects . Unlike SELECT queries

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 that is marked (annotated) as having the ability to represent objects in the database. Conceptually

Database Schema Evolution

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 ... that enables transparent use of old entity objects after schema change. When an entity object

JPA Lifecycle Events

objects of the subclasses unless that callback method is overridden by the subclass. Implementation ... methods and should not access any other entity objects . If a callback method throws an exception ... onPrePersist( Object o) {} @PostPersist void onPostPersist( Object o) {} @PostLoad void onPostLoad( Object o

UPDATE SET Queries in JPA/JPQL

Existing entity objects can be updated, as explained in chapter 2 , by: Retrieving the entity objects into an EntityManager . Updating the relevant entity object fields  ... provide an alternative way of updating entity objects . Unlike SELECT queries, which are used

JPA Query Structure (JPQL / Criteria)

classes and objects . For example, a JPQL query can retrieve and return entity objects rather than just field values from database tables, as with SQL. That makes JPQL more object oriented friendly ... Query The following query retrieves all the Country objects in the database: SELECT c FROM Country

WHERE clause (JPQL / Criteria API)

JPQL query that retrieves selective objects from the database. Out of the four optional clauses ... over all the Country objects in the database using the c range variable. Before passing these Country objects to the SELECT clause for collecting as query results, the WHERE clause gets an opportunity

Apache License, Version 2.0, January 2004

to software source code, documentation source, and configuration files. " Object " form shall mean any form ... to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as

Setting and Tuning of JPA Queries

in Query and TypedQuery support method chaining (by returning the query object ... automatic optimistic locking to prevent concurrent changes to entity objects by multiple users. JPA 2 ... on all the result objects that the query retrieves. For example, the following query execution sets

Index Definition

Querying without indexes requires iteration over entity objects in the database one by one. This may take a significant amount of time if many entity objects have to be examined. Using proper indexes the iteration can be avoided and complex queries over millions of objects can be executed quickly

What is ObjectDB?

ObjectDB is an Object Oriented Database Management System (ODBMS). It provides all the standard ... , etc.), but it uses an object oriented model to store and manage data. You can easily store ordinary objects (and graphs of objects ) in an ObjectDB database directly. There's no need to define tables

Query Parameters in JPA

) The following method retrieves a Country object from the database by its name: public Country ... ). getSingleResult (); } The WHERE clause reduces the query results to Country objects whose name field value ... that is built by using the JPA Criteria API - parameters (as other query elements) are represented by objects

CRUD Database Operations with JPA

Given an EntityManager , em , that represents a JPA connection to the object database, we can use it to store, retrieve, update and delete database objects . Storing New Entity Objects The following code fragment stores 1,000 Point   objects in the database: em. getTransaction (). begin

JPA Exceptions

JPA exceptions are represented by a hierarchy of unchecked exceptions: java.lang. Object java.lang ... because of an attempt to store a new entity object with a primary key that is already in use by another existing entity object , the nested exception is: Other common causes for RollbackException are lock failures

JPA Persistable Types

class can only be stored in the database as embedded objects , i.e. as part of a containing entity object . A class is declared as embeddable by marking it with the Embeddable annotation: @Embeddable ... ;String zip; } Instances of embeddable classes are always embedded in other entity objects and do not

Auto Generated Values

number generator for every database. This number generator is used to generate automatic object IDs for entity objects with no primary key fields defined (as explained in the previous section ). The same ... for every new entity object . These generated values are unique at the database level and are never recycled

JPA Query API

results and the lowest known common denominator of all the result objects is Object ... which retrieves all the Country objects in the database is represented by both q1 and q2 . When building ... objects ), a TypedQuery is preferred. There is another advantage of using  TypedQuery  in

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 JDBC. Using plain old Java objects (POJO) to represent persistent data can significantly simplify ... . These implementations are Object Relational Mapping (ORM) tools. The mapping bridges between the data

What are the main benefits of using ObjectDB?

. The ability to store ordinary objects in the database directly can simplify the code significantly ... ObjectDB is especially designed to store and manage graphs of objects efficiently. That can accelerate the execution time of object oriented applications significantly. For instance, collection and map

ORDER BY clause (JPQL / Criteria API)

produces objects for examination and the WHERE clause selects which objects to collect as results ... Country objects ordered by currency as the primary sort key and by name as the secondary sort key ... receives groups rather than individual objects and ORDER BY can order these groups. For example: SELECT c

ObjectDB Overview

The ObjectDB Object Database ObjectDB is a powerful Object -Oriented Database Management ... Features 100% pure Java Object -Oriented Database Management System (ODBMS). No proprietary API ... , JBoss and Spring. See the  ObjectDB Object Database Features  for more details.

JPA Class Enhancer

loading of entity objects . With no enhancement, only persistent collection and map fields can be loaded lazily (by using proxy objects ), but persistent fields that reference entity objects directly

JPA Named Queries

whose name is  "Country.findAll" that retrieves all the  Country objects in the database ... queries. But, because mapping files are useful mainly for Object Relational Mapping (ORM) JPA providers ... of, and that includes all the entity classes that have objects in the database. However, an attempt to use a named query

Step 2: Entity Class and Persistence Unit

To store objects in an ObjectDB database using JPA we need to define an entity class: Open ... objects in the database was created in the project (under Java Resources: src guest). Use copy ... with the specified database url. The next step is adding an EJB Session Bean that will manage Guest entity objects .

Step 4: Add a Controller Class

the next tutorial step) - a new Guest entity object is constructed and stored in the database. Processing ... output. The JSP uses the GuestDao component to display the existing Guest objects . The returned ModelAndView object defines a target JSP ( "guest.jsp" ) and passes the GuestDao component to the JSP as

Step 2: Entity Class and Persistence Unit

To store objects in an ObjectDB database using JPA we need to define an entity class: Open ... objects in the database was created in the project (under Source Packages guest). Use copy and paste ... with the specified database url. The next step is adding an EJB Session Bean that will manage Guest entity objects .

Step 3: Define a Spring DAO Component

Operations on the database will be performed by an instance of a Data Access Object (DAO ... - for storing a new  Guest entity object in the database. getAllGuests - for retrieving all the existing  Guest objects from the database. By using Spring components we can move some work from

Which API should I use - JPA or JDO?

You can use ObjectDB with either the Java Persistence API (JPA) or the Java Data Objects (JDO) API ... , tutorials and sample code. When to prefer JDO JDO might be preferred when portability to other object databases is more important than general portability to both object and relational databases. JPA

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