Internal Website Search

1-50 of 200 results

JPA Persistence Unit

A JPA Persistence Unit is a logical grouping of user defined persistable classes (entity classes ... is optional when using ObjectDB, but required by JPA . persistence.xml Persistence units are defined in ... to instantiate an EntityManagerFactory in JPA (as explained in the JPA Overview section) requires

JPA Query API

Queries are represented in JPA 2 by two interfaces - the old Query interface, which was the only interface available for representing queries in JPA 1, and the new TypedQuery interface that was introduced in JPA 2. The TypedQuery interface extends the Query interface. In JPA 2 the Query interface

JPA Criteria API Queries

The JPA Criteria API provides an alternative way for defining JPA queries, which is mainly useful for building dynamic queries whose exact structure is only known at runtime. JPA Criteria API vs JPQL JPQL queries are defined as strings, similarly to SQL. JPA criteria queries, on the other hand

ObjectDB - JPA Object Database for Java

it is the bottleneck in most applications. ObjectDB is extremely fast and much faster than any other JPA ... when the object data model is complex. See JPA benchmark results...   Reduce development time. Improve ... using the Java Persistence API ( JPA ). It is the first persistence solution that combined a powerful

JPA Entity Fields

either the Java transient modifier (which also affects serialization) or the JPA @Transient annotation ... . Basic - for any other persistable type. In JPA only Basic is optional while the other annotations ... , so they are useful only for classes that are also in use with an ORM JPA provider (such as

What is the Java Persistence API (JPA)?

The Java Persistence API ( JPA ) is a standard API for accessing databases from within Java applications. The main advantage of JPA over JDBC (the older Java API for interacting with databases) is that in JPA data is represented by classes and objects rather than by tables and records as in

JPA Persistable Types

. ObjectDB supports all the JPA persistable types, which are: User defined classes - Entity classes ... .persistence.Entity; @ Entity public class MyEntity { } Entity Class Requirements A portable JPA entity class ... Superclasses In JPA , classes that are declared as mapped superclasses have some of the features of entity

Setting and Tuning of JPA Queries

of other EntityManager instances). JPA implementations can easily make uncommitted changes visible in simple JPA ... to be visible to the query. Flush policy in JPA is represented by the FlushModeType enum, which has two values ... are flushed only on explicit commit/flush. In most JPA implementations the default is AUTO . In ObjectDB

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 ... is an ordinary Java class. The only unique JPA addition is the @Entity annotation, which marks the class as

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

JPA Metamodel API

The JPA Metamodel API, which is introduced in JPA 2.0, enables examining the classes, fields ... of the JPA Metamodel API is: Types (mainly classes) and attributes (persistent field and properties ... : The JPA Metamodel API may optionally be used with the JPA Criteria API. Many of the interfaces

Query Parameters in JPA

identifier that serves as the parameter name. JPA does not provide an API for defining the parameters ... ). Therefore, they are preferred over ordinal parameters. Criteria Query Parameters In a JPA query that is built by using the JPA Criteria API - parameters (as other query elements) are represented by objects

JPA Reference (JavaDoc)

( JPA ) 2.0. The content is derived from the original JPA documentation (in the EclipseLink JPA 2 RI) with some additions and notes. The JPA types are organized into the following sections: The purpose of these documentation pages is to serve as a reference. In order to learn how to use JPA and ObjectDB please read the ObjectDB manual .

JPA Class Enhancer

(and actually required by JPA but not enforced by ObjectDB) to avoid accessing persistent fields ... on the Tutorial pages: Quick Start with JPA JPA Web Application Java EE JPA Spring MVC and JPA

JPA Named Queries

Country { ... } Note: Named queries can be defined in JPA XML mapping files instead of using the @NamedQuery annotation. ObjectDB supports JPA XML mapping files, including the definition of named queries. But, because mapping files are useful mainly for Object Relational Mapping (ORM) JPA providers

Locking in JPA

JPA 2 supports both optimistic locking and pessimistic locking . Locking is essential to avoid ... in ObjectDB (and in JPA ) is always at the database object level, i.e. each database object ... (which is required by some ORM JPA providers) is defined in the entity class or not. Pessimistic Locking The main

Retrieving JPA Entity Objects

The Java Persistence API ( JPA ) provides various ways to retrieve objects from the database ... is available in objects that are detached. JPA 2 introduces methods for checking if a specified entity object ... of JPA is JPQL (Java Persistence Query Language). It enables retrieval of objects from the database by

JPA Queries

Queries are represented in JPA  by the Query and TypedQuery interfaces: The JPA Query API section (in chapter 4 of the ObjectDB manual) provides detailed explanation of how exactly to use ... ) can be done by concatenating JPQL strings into a valid complete JPQL query. JPA 2 introduced the JPA Criteria

Database Connection using JPA

Working with the Java Persistence API ( JPA ) consists of using the following interfaces: Overview ... for Query instances, which are needed for executing queries on the database. Every JPA implementation ... of ObjectDB classes that implement these interfaces, and because standard JPA interfaces are used

Updating JPA Entity Objects

. It is usually recommended to use collections rather than arrays when using JPA . Collections are more portable to ORM JPA implementations and provide better automatic change tracking support. UPDATE ... in one operation. The UPDATE Queries in JPA /JPQL in chapter 4 explains how to use JPA UPDATE queries.

Chapter 4 - JPA Queries (JPQL / Criteria)

The JPA Query Language (JPQL) can be considered as an object oriented version of SQL. Users ... well as how to use the JPA Criteria API, which provides an alternative way for building queries in JPA , based on JPQL. The first section describes the API that JPA provides for using dynamic and static

Obtaining a JPA Database Connection

In JPA a database connection is represented by the EntityManager interface. Therefore, in order ... to get an EntityManager instance. JPA requires the definition of a persistence unit in an XML file in order ... to the database. When using JPA , every operation on a database is associated with an EntityManager

Chapter 3 - Using JPA

This chapter explains how to manage ObjectDB databases using the Java Persistence API ( JPA ). The first two pages introduce basic JPA interfaces and concepts: The next section explains how to use JPA for database CRUD operations: More advanced topics (e.g. locking and events) are discussed in the last section:

Deleting JPA Entity Objects

, if any). Orphan Removal JPA 2 supports an additional and more aggressive remove cascading mode ... ;The  DELETE Queries in JPA /JPQL  in chapter 4 explains how to use JPA DELETE queries.

JPA Primary Key

required. But ObjectDB also supports explicit standard JPA primary keys, including composite primary ... has multiple primary key fields, JPA requires defining a special ID class that is attached to the entity ... itself can represent complete primary key values. Obtaining the Primary Key JPA 2 provides a generic method

JPA Annotations for JPQL Queries

The following annotations are used to define static named JPA queries: The JPA Named Queries section of the ObjectDB Manual explains and demonstrates how to use these annotations to define named JPQL queries.

JPA Annotations for SQL Queries

The following JPA annotations are designated for SQL queries on relational databases: ObjectDB supports only the preferred JPA query language, JPQL, and silently ignores all the above annotations.

JPA Annotations for Java EE

The following JPA annotations are in use to integrate JPA into a Java EE application and are managed by the Java EE container:

JPA Tutorials

The following tutorials demonstrate how to develop database driven applications using JPA and the ObjectDB ODBMS (Object Oriented Database Management System). Console JPA Tutorial The Quick Start tutorial demonstrates how to use ObjectDB and JPA in a console application: Quick Start with JPA

Getting Started with JPA

This tutorial demonstrates how to create and run a simple JPA application. The demonstrated application uses JPA to store and retrieve simple  Point entity objects, where each  Point has two persistent fields -  x and  y . If you already know JPA - the source code

Eclipse/JPA Spring MVC Web Tutorial

This is the Eclipse version of the  Spring MVC and JPA tutorial. It demonstrates  ... Eclipse - using ObjectDB, JPA , Tomcat (or GlassFish) and Maven. The demo web application manages ... that have already signed are listed below the form: Persistence is managed by JPA . Every visitor

NetBeans/JPA Spring MVC Web Tutorial

This is the NetBeans version of the Spring MVC and JPA tutorial. It demonstrates  ... NetBeans - using JPA , ObjectDB, Tomcat (or GlassFish) and Maven. The demo web application ... . The visitors that have already signed are listed below the form: Persistence is managed by JPA

JPA Web App Tutorial - Maven Project

The  JPA Web Application tutorial provides step by step instructions on how to build a simple Java/ JPA database driven web application (for Tomcat / Jetty) in  Eclipse or  NetBeans ... , you may download and run the result application as a Maven project: JPA Web App - Maven Project (6KB

Spring MVC and JPA Tutorial

) web application using Tomcat (or GlassFish), JPA , ObjectDB and Maven. The demo web application manages ... that have already signed are listed below the form: Persistence is managed by JPA . Every visitor that has signed the guestbook is represented as Guest JPA entity object, and all Guest entity objects

Getting Started with JPA and Eclipse

This is the Eclipse version of the Quick Start with JPA tutorial. It demonstrates how to create and run a simple JPA application in Eclipse. The demonstrated application uses JPA to store and retrieve simple Point entity objects, where each Point has two persistent fields: x and y

NetBeans/JPA Web Application Tutorial

This is the NetBeans version of the  JPA Web App tutorial. It demonstrates how  ... Server 6.0 ( some modifications are needed for Tomcat 7.0 ), ObjectDB and JPA . The demo web ... form. The visitors that have already signed are listed below the form: Persistence is managed by JPA

Eclipse/JPA Java EE Tutorial

This is the Eclipse version of the Java EE JPA tutorial. It demonstrates how  ... GlassFish, ObjectDB and JPA . The demo web application manages a basic guestbook page. Every visitor ... below the form: Persistence is managed by JPA . Every visitor that has signed the guestbook is represented

Eclipse/JPA Web Application Tutorial

This is the Eclipse version of the JPA Web App tutorial. It demonstrates how to create and run a database driven Java web application in Eclipse - using Tomcat 6, ObjectDB and JPA ... is managed by JPA . Every visitor that has signed the guestbook is represented by a Guest entity object

Getting Started with JPA - Maven Project

The Getting Started with JPA tutorial provides step by step instructions on how to build a simple JPA database driven application in Eclipse or NetBeans . Building a new application step by step ... application as a Maven project:      Getting Started with JPA - Maven Project (3KB

Spring MVC JPA Tutorial - Maven Project

The  Spring MVC JPA tutorial provides step by step instructions on how to build a simple Java/ JPA Spring MVC database driven web application in  Eclipse or  NetBeans . Building a new ... , you may download and run the finished application as a Maven project: Spring MVC JPA - Maven Project (8KB) If 

NetBeans/JPA Java EE Tutorial

This is the NetBeans version of the  Java EE JPA tutorial. It demonstrates  ... NetBeans - using GlassFish, ObjectDB and JPA . The demo web application manages a basic guestbook page ... that have already signed are listed below the form: Persistence is managed by JPA . Every visitor that has signed

Getting Started with JPA and NetBeans

This is the NetBeans version of the  Quick Start with JPA tutorial. It demonstrates how to create and run a simple JPA application in NetBeans. The demonstrated application uses JPA to store and retrieve simple  Point entity objects, where each  Point has two persistent fields

Spring MVC JPA Tutorial - IntelliJ Project

To open and run the  Spring MVC JPA tutorial project in Download and extract the project zip file: Spring MVC JPA - Maven Project (8KB) Open the project in IntelliJ IDEA: Select  File Open Project... . Select the  guestbook-spring directory and click  OK . Define

JPA Web App Tutorial - NetBeans Project

To open and run the  JPA Web Application tutorial project in NetBeans: Download and extract the project zip file: JPA Web App - Maven Project (6KB) Open the Maven project in NetBeans: Select  File Open Project... . Select the  guestbook-web directory and click  Open

Java EE JPA Tutorial - Maven Project

The  Java EE Web Application tutorial provides step by step instructions on how to build a simple Java/ JPA database driven web application (for GlassFish 3/ JBoss 6) in  Eclipse or  ... ;if you prefer, you may download and run the result application as a Maven project: Java EE  JPA Web

Spring MVC JPA Tutorial - Eclipse Project

To open and run the  Spring MVC JPA tutorial project in Eclipse: Download and extract the project zip file: Spring MVC JPA - Maven Project (8KB) Open the Maven project in Eclipse: Select  File Import... Maven Existing Maven Projects and click  Next . Select the  guestbook

JPA Web Application Tutorial

This tutorial demonstrates how to create and run a database driven Java web application using Tomcat 6, ObjectDB and JPA . The demo web application manages a basic guestbook page. Every visitor ... below the form: Persistence is managed by JPA . Every visitor that has signed the guestbook is represented

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 ... a context listener class that will manage a JPA's EntityManagerFactory representing the ObjectDB database.

Getting Started with JPA - NetBeans Project

To open and run the  Quick Start with JPA tutorial project in NetBeans: Download and extract the project zip file: Getting Started with JPA - Maven Project (3KB) Open the Maven project in NetBeans: Select File Open Project... . Select the points-console directory and click Open Project . Run

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. Both share similar architecture, design and abilities. When to prefer JPA JPA is more commonly used. Therefore, it might be the first choice for most new applications. You can use JPA as