ObjectDB Database Search

101-150 of 200 results

orphanRemoval = true not working when CascadeType.REMOVE is disabled

orphanRemoval = true not working when CascadeType.REMOVE is disabled

select query for a HashMap field of an entity.

select query for a HashMap field of an entity.

Class fields selection to store

Class fields selection to store

selective update does not work

selective update does not work

Selective merge/cascade of detatched entity

Selective merge/cascade of detatched entity

JPA Query API

for both Query and TypedQuery : Query q1 = em. createQuery (" SELECT c FROM Country c"); TypedQuery q2 = em. createQuery (" SELECT c FROM Country c", Country.class); In the above code, the same JPQL query

Remove of an entry from a @OneToMany collection is not possible if the enhancer is disabled

Remove of an entry from a @OneToMany collection is not possible if the enhancer is disabled

Setting and Tuning of JPA Queries

.findAll", query =" SELECT c FROM Country c",      hints ={@ QueryHint (name

JPA Query Expressions (JPQL / Criteria)

Query expressions are the foundations on which JPQL and criteria queries are built. Every query consists of clauses - SELECT , FROM, WHERE, GROUP BY, HAVING and ORDER BY, and each clause consists of JPQL / Criteria query expressions. Atomic Expressions The atomic query expressions are: JPQL

Literals in JPQL and Criteria Queries

to enable selective retrieval by type . In JPQL an entity type literal is written simply as the name

Posting Sample Code

(" SELECT e FROM MyEntity e");         List resultList = query

ObjectDB Object Database Features

, max) - for paging. Query Structure SELECT (including NEW ). FROM (including INNER JOIN , LEFT OUTER

Chapter 4 - JPA Queries (JPQL / Criteria)

(and a criteria query) is explained by describing the main clauses of JPQL queries ( SELECT , FROM, WHERE, GROUP

JPA Primary Key

and a benchmark might be needed to evaluate the different alternatives in order to select the best solution.

InterfaceRef jakarta.persistence.criteria.CriteriaBuilder

JPA Interface CriteriaBuilder Used to construct criteria queries, compound selections , expressions ... Return: any expression Since: JPA 2.0 CompoundSelection array (List   selections ) Create an array-valued selection item. Parameters: selections - list of selection items Return: array-valued

EnumRef jakarta.persistence.SharedCacheMode

. Since: JPA 2.0 DISABLE _ SELECTIVE Caching is enabled for all entities except those for which Cacheable ... ENABLE_ SELECTIVE Caching is enabled for all entities for which Cacheable(true) is specified. All other entities are not cached. Since: JPA 2.0 NONE Caching is disabled for the persistence unit

InterfaceRef jakarta.persistence.criteria.CompoundSelection

JPA Interface CompoundSelection Type Parameters: - the type of the selection item Super Interfaces: Selection , TupleElement The CompoundSelection interface defines a compound selection item (a tuple, array, or result of a constructor). Since: JPA 2.0 Public Methods Selection alias (String 

InterfaceRef jakarta.persistence.criteria.CriteriaQuery

Since: JPA 2.0 Selection getSelection () Return the selection of the query, or null if no selection has been set. Return: selection item Inherited from: AbstractQuery Since: JPA 2.0 CriteriaQuery ... : the modified query Since: JPA 2.0 CriteriaQuery select ( Selection   selection ) Specify the item

AnnotationRef jakarta.persistence.Cacheable

JPA Annotation Cacheable Target: TYPE Implemented Interfaces: Annotation Specifies whether an entity should be cached, if caching is enabled, and when the value of the persistence.xml caching element is SharedCacheMode.ENABLE_ SELECTIVE or SharedCacheMode. DISABLE _ SELECTIVE . The value

Step 3: Create an ObjectDB Data Source

Connections to the database are represented in BIRT as data sources. To create an ObjectDB data source: Open the [New Data Source] dialog box by right clicking the Data Sources node in the [Data Explorer] window and selecting   New Data Source . Select ObjectDB Data Source from the list

Step 6: Design a BIRT Report Table

) layout. Set the column number to 2 , number of details to 1 , select the data set (e.g. Points by X ... in the [Navigator] window and selecting Report Run Report :  

Step 3: Define a Spring DAO Component

clicking the guest package node (in the [Package Explorer] window) and selecting   New Class ... getAllGuests() { TypedQuery query = em.createQuery( " SELECT g FROM Guest g ORDER BY g.id", Guest.class); return

Step 2: Create a Project and a Report

To use BIRT we need to create a BIRT Report project in Eclipse: Open the [New Project] dialog box, e.g. by using File New Project... Select Business Intelligence and Reporting Tools Report Project ... project: Right click the Reports node in the [Navigator] and select New Report . Enter the report

Step 1: Create a Web Project

We start by creating a new Eclipse Dynamic Web Project: Open the [New Project] dialog box, e.g. by using File New Project... Select Web Dynamic Web Project and click Next . Choose a Project Name (e.g. Guestbook ). Select Apache Tomcat v6.0 as the Target runtime. Note: You may have to add Tomcat 6

Step 3: Add a Context Listener Class

File] dialog box by right clicking the guest package node (in the [Projects] window) and selecting New Other... Select Web Web Application Listener and click Next . Enter GuestListener as the class name

Step 1: Create a Java Project

Project] dialog box: Select Java Project and click Next . Choose a Project Name (e.g. Tutorial ) and click Next . In the Libraries tab, click Add External JARs... and select the objectdb.jar file from

Step 3: Define an EJB Session Bean

node (in the [Package Explorer] window) and selecting New Class . The package name should be guest ... ); } // Retrieves all the guests: public List getAllGuests() { TypedQuery query = em.createQuery( " SELECT g FROM

Step 4: Add a Servlet Class

In this step we will add a servlet to manage guestbook web requests: Open the [New Servlet] dialog box by right clicking the guest package node (in the [Projects] window) and selecting New Servlet ... .getTransaction().commit(); } // Display the list of guests: List guestList = em.createQuery( " SELECT g FROM

Step 5: Add a JSP Page

In this step we will add the JSP that generates the guestbook HTML output: Open the [New JSP File] dialog box by right clicking the WEB-INF node under the Web Pages node (in the [Projects] window) and selecting New JSP ... Enter guest as the jsp file name - use exactly that case sensitive class

Step 4: Run the Application

You can run the application now by right clicking the Main node (in the [Projects] window) and selecting Run File . The expected output in the [Output] window, is: Total Points: 1000 Average X: 499.5 (0,0) (1,1) (2,2) (3,3) : : (998,998) (999,999) When you run the application for the first time

Step 4: Add a Controller Class

In this step we will add a Spring Controller to manage guestbook web requests: 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  GuestController as

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: 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 6: Run the Java EE 6 Application

You can run the application now by right clicking the GuestServlet node (in the [Project Explorer] window) and selecting Run As Run on Server Finish : Since we are using ObjectDB in embedded mode - the database file is created under the GlassFish directory (e.g. at domains\domain1\eclipseApps

Step 5: Add a JSP Page

In this step we will add the JSP that generates the guestbook page output: Open the [New JSP File] dialog box by right clicking the Web Pages node (in the [Projects] window) and selecting New JSP ... Enter guest as the jsp file name - use exactly that case sensitive class name. Click Finish

Step 4: Run the Application

You can now run the application by right clicking the Main.java file (in the [ Package Explorer ] window) and selecting Run As Java Application . The expected output in the Eclipse [Console] window, is: Total Points: 1000 Average X: 499.5 (0,0) (1,1) (2,2) (3,3) : : (998,998) (999,999

Step 6: Run the Web Application

You can run the application now by right clicking the GuestServlet node (in the [Project Explorer] window) and selecting Run As Run on Server Finish : Since we are using ObjectDB in embedded mode - the database file is created under the Tomcat directory. You can stop the Tomcat server and open

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 4: Add a Controller Class

In this step we will add a Spring Controller to manage guestbook web requests: Open the [New Java 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

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 6: Run the Java EE 6 Application

You can run the application now by right clicking the  GuestServlet node (in the [Projects] window), selecting   Run File , and then clicking  OK (no need to change the servlet execution URI). Since we are using ObjectDB in embedded mode - the database file is created

Step 6: Run the Web Application

You can run the application now by right clicking the GuestServlet node (in the [Projects] window), selecting Run File , and then clicking  OK (no need to change the servlet execution URI). Since we are using ObjectDB in embedded mode - the database file is created under the Tomcat directory

Step 5: Add a JSP Page

In this step we will add the JSP that generates the guestbook page output: Open the [New JSP File] dialog box by right clicking the Web Pages node (in the [Projects] window) and selecting New JSP ... Enter guest as the jsp file name - use exactly that case sensitive class name. Click Finish

Step 5: Add a JSP Page

In this step we will add the JSP that generates the guestbook page output: Open the [New JSP File] dialog box by right clicking the WebContent node (in the [Package Explorer] window), selecting   New Other... Web JSP File and clicking  Next . Enter  guest as the jsp file name

Step 5: Add a JSP Page

In this step we will add the JSP that generates the guestbook HTML output: Open the [New JSP File] dialog box by right clicking WEB-INF under src/main/webapp (in the [Package Explorer] window), selecting   New Other... Web JSP File and clicking Next . The parent folder should be WEB-INF

Step 4: Add a Servlet Class

In this step we will add a servlet to manage guestbook web requests: Open the [New Servlet] dialog box by right clicking the guest package node (in the [Projects] window) and selecting New Servlet ... Enter GuestServlet as the class name - use exactly that case sensitive class name. The Java

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 5: Add a JSP Page

In this step we will add the JSP that generates the guestbook page output: Open the [New JSP File] dialog box by right clicking the WebContent node (in the [Package Explorer] window), selecting New Other... Web JSP File and clicking Next . Enter guest as the jsp file name - use exactly

Step 4: Add a Servlet Class

In this step we will add a servlet to manage guestbook web requests: Open the [Create Servlet] dialog box by right clicking the guest package node (in the [Package Explorer] window), selecting   New Other... Web Servlet and clicking  Next . The Java package name should be guest. Enter

Which API should I use - JPA or JDO?

that are supported only by JDO.  Selecting the more popular API leads to more portable application