Internal Website Search

1-50 of 200 results

SELECT clause (JPQL / Criteria API)

= em. createQuery (" SELECT c FROM Country c", Country.class); List results = query. getResultList ... the ability to use almost any valid JPQL expression in SELECT clauses. Specifying the required query ... the " SELECT  *" expression (which is commonly used in SQL). Projection of Path Expressions JPQL

Criteria Query Selection and Results

The JPA Criteria API interfaces in this group are used for setting the SELECT and ORDER BY clauses and for representing query results as tuples. SELECT Clause Elements The content of the SELECT clause in a criteria query is represented by Selection : Because Selection  is a super interface

CriteriaQuery.select(selection) - JPA Method

JPA Method in javax.persistence.criteria.CriteriaQuery CriteriaQuery select (    Selection   selection ) Specify the item that is to be returned in the query result. Replaces the previously specified selection (s), if any. Note: Applications using the string-based API may need

GROUP BY and HAVING clauses

clause in the query execution order is after the FROM and WHERE clauses, but before the SELECT ... ) are sent to grouping by the GROUP BY clauses before arriving at the SELECT clause. GROUP BY as DISTINCT (no Aggregates) The following query groups all the countries by their first letter: SELECT SUBSTRING(c

FROM clause (JPQL / Criteria API)

over all the Country objects in the database: SELECT c FROM Country AS c The AS keyword is optional, and the same query can also be written as follows: SELECT c FROM Country c By default, the name ... returns all the pairs of countries that share a common border: SELECT c1, c2 FROM Country c1, Country c2

ORDER BY clause (JPQL / Criteria API)

is at least one million people, ordered by the country name: SELECT c.name FROM Country c WHERE c.population 1000000 ... produces objects for examination and the WHERE clause selects which objects to collect as results. Then the SELECT clause builds the results by evaluating the result expressions. Finally the results

Database Explorer

Embedded...  command and select a local database file. To open a database in client-server mode select File Open C/S Connection...  and provide host, port, username and password for a client ... ] tabbed window or select an element for viewing (an entity class in the [Schema] tabbed window

javax.persistence.criteria.Selection

JPA Interface Selection Type Parameters: - the type of the selection item Super Interfaces: TupleElement The Selection interface defines an item that is to be returned in a query result. Since: JPA 2.0 The SELECT clause (JPQL / Criteria API) article explains how to use Selection . Public Methods

WHERE clause (JPQL / Criteria API)

The WHERE clause adds filtering capabilities to the FROM- SELECT structure. It is essential in any JPQL query that retrieves selective objects from the database. Out of the four optional clauses ... : SELECT c FROM Country c WHERE c.population :p The FROM clause of this query defines an iteration

CriteriaQuery.multiselect(selections) - JPA Method

; Selection ...  selections ) Specify the selection items that are to be returned in the query result. Replaces the previously specified selection (s), if any. The type of the result of the query ... array-valued compound selection item. The semantics of this method are as follows: If the type

CriteriaBuilder.array(selections) - JPA Method

JPA Method in javax.persistence.criteria.CriteriaBuilder CompoundSelection array (    Selection ...  selections ) Create an array-valued selection item. Parameters: selections - selection items Return: array-valued compound selection Throws: IllegalArgumentException - if an argument is a tuple- or array-valued selection item Since: JPA 2.0

CriteriaBuilder.tuple(selections) - JPA Method

JPA Method in javax.persistence.criteria.CriteriaBuilder CompoundSelection tuple (    Selection ...  selections ) Create a tuple-valued selection item. Parameters: selections - selection items Return: tuple-valued compound selection Throws: IllegalArgumentException - if an argument is a tuple- or array-valued selection item Since: JPA 2.0

CriteriaBuilder.construct(resultClass,selections) - JPA Method

;Class  resultClass,     Selection ...  selections ) Create a selection item ... whose instance is to be constructed selections - arguments to the constructor Return: compound selection item Throws: IllegalArgumentException - if an argument is a tuple- or array-valued selection item Since: JPA 2.0

Selection.getCompoundSelectionItems() - JPA Method

JPA Method in javax.persistence.criteria. Selection List getCompoundSelectionItems () Return the selection items composing a compound selection . Modifications to the list do not affect the query. Return: list of selection items Throws: IllegalStateException - if selection is not a compound selection Since: JPA 2.0

Selection.isCompoundSelection() - JPA Method

JPA Method in javax.persistence.criteria. Selection boolean isCompoundSelection () Whether the selection item is a compound selection . Return: boolean indicating whether the selection is a compound selection Since: JPA 2.0

Selection.alias(name) - JPA Method

JPA Method in javax.persistence.criteria. Selection Selection alias (   String name ) Assigns an alias to the selection item. Once assigned, an alias cannot be changed or reassigned. Returns the same selection item. Parameters: name - alias Return: selection item Since: JPA 2.0

Subquery.select(expression) - JPA Method

JPA Method in javax.persistence.criteria.Subquery Subquery select (    Expression  expression ) Specify the item that is to be returned as the subquery result. Replaces the previously specified selection , if any. Parameters: expression - expression specifying the item

javax.persistence.SharedCacheMode.ENABLE_SELECTIVE

JPA Enum Constant in javax.persistence.SharedCacheMode ENABLE_ SELECTIVE Caching is enabled for all entities for Cacheable(true) is specified. All other entities are not cached. Since: JPA 2.0

javax.persistence.SharedCacheMode.DISABLE_SELECTIVE

JPA Enum Constant in javax.persistence.SharedCacheMode DISABLE_ SELECTIVE Caching is enabled for all entities except those for which Cacheable(false) is specified. Entities for which Cacheable(false) is specified are not cached. Since: JPA 2.0

JPA Query Structure (JPQL / Criteria)

and easier to use in Java. JPQL Query Structure As with SQL, a JPQL SELECT query also consists of up to 6 clauses in the following format: SELECT ... FROM ... [WHERE ...] [GROUP BY ... [HAVING ...]] [ORDER BY ...] The first two clauses, SELECT and FROM are required in every retrieval query

JPA Criteria API Queries

: SELECT c FROM Country c An equivalent query can be built using the JPA criteria API as follows ... ); Root c = q. from (Country.class); q. select (c); The CriteriaBuilder interface serves as the main ... clause. Finally, the range variable, c , is also used in the SELECT clause as the query result

Running JPA Queries

The Query interface defines two methods for running SELECT queries: Query.getSingleResult ... : TypedQuery query = em. createQuery (" SELECT c FROM Country c", Country.class); List results = query ... = em. createQuery (" SELECT c FROM Country c"); List results = query. getResultList (); An attempt

Shared (L2) Entity Cache

to one of the following values: NONE - cache is disabled. ENABLE_ SELECTIVE - cache is disabled except for selected entity classes (see below). DISABLE_ SELECTIVE - cache is enabled except for selected ... regardless of the set mode. Entity Class Cache Settings The  ENABLE_ SELECTIVE mode indicates

BIRT/ODA ObjectDB Driver

Developers extension. To install it: Open the [Install] dialog box by selecting Help Install New Software ... and press ENTER. Select the ObjectDB Birt/ODA feature. Complete the installation by clicking Next twice ... ] window and selecting   New Data Source . Select ObjectDB Data Source from the list of available

JPA Named Queries

: @NamedQuery ( name ="Country.findAll", query =" SELECT c FROM Country c") The  @NamedQuery annotation ... . But since the scope of named queries is the entire persistence unit, names should be selected ... ", query =" SELECT c FROM Country c") public class Country { ... } Attaching multiple named queries

Paths and Types in JPQL and Criteria API

identification variables and SELECT result variables. Parameters - when instances of these classes ... : SELECT c.name, c.capital.name FROM Country c The c  identification variable is used ... : SELECT COUNT(e) FROM Object e WHERE TYPE(e) Country Binding an identification variable ( e

Index Definition

and range queries: SELECT p FROM Point p WHERE p.x = 100 SELECT p FROM Point p WHERE p.x BETWEEN 50 AND 80 SELECT p FROM Point p WHERE p.x = 50 AND p.x = 10 But this time a full index scan is required ... for sorting results and for projection: SELECT MIN(p.x) FROM Point p WHERE p.x

DELETE Queries in JPA/JPQL

DELETE queries provide an alternative way for deleting entity objects. Unlike SELECT queries ... . Selective Deletion The structure of DELETE queries is very simple relative to the structure of SELECT queries. DELETE queries cannot include multiple variables and JOIN, and cannot include the GROUP

Query Parameters in JPA

getCountryByName( EntityManager em, String name) { TypedQuery query = em. createQuery ( " SELECT c FROM ... ( EntityManager em, String name) { TypedQuery query = em. createQuery ( " SELECT c FROM Country c ... added value to the clarity of the query string (assuming that meaningful names are selected

JPA Entity Fields

the following query (where :d represents the Department entity): SELECT e FROM Employee e WHERE e ... of the following query: SELECT e FROM Employee e WHERE e.department = :d ORDER BY e.name The specified field ... from the inverse query results by specifying a selected key field using the MapKey annotation

Logical Operators in JPQL and Criteria API

query retrieves countries whose population and area (both) exceed specified limits: SELECT c FROM ... The following query retrieves countries whose population or area exceeds a specified limit: SELECT c ... The following query retrieves all the countries whose population does not exceed a specified limit: SELECT

[ODB1] Chapter 9 - ObjectDB Explorer

toolbar button) and in the Open dialog box select the desired local database file and click the "Open ... " button that opens the "Remote File Selection " dialog box. Closing the Database Use the "File | Close ... is open. The "Class" window shows all the persistent classes in the database. You can select a class

Spring MVC JPA Tutorial - IntelliJ 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 the Server: Select   File Settings Application Servers . Add Tomcat 6 Server if not set already (Tomcat

JPA Web App Tutorial - IntelliJ Project

: Select File Open Project... . Select the guestbook-web directory and click OK . Define the Server: Select File Settings Application Servers . Add Tomcat 6 Server if not set already (Tomcat has to be downloaded separately). Define Run Configuration: Select Run Edit Configurations , click the + icon

Java EE 6 JPA Tutorial - IntelliJ Project

the project in IntelliJ IDEA: Select   File Open Project... . Select the  guestbook-jee6 directory and click  OK . Define the Server: Select   File Settings Application Servers . Add ... : Select   Run Edit Configurations , click the  + icon and select   Tomcat Server Local

Step 7: Run the Spring Web App

- you should be able to run your application now by selecting Run Run Main Project from the main menu (or F6 ): You can select the server in the Run category of the project properties window (right click the project node and select Properties to open it). Alternatively you can run the web application using

Step 1: Install BIRT and ObjectDB Driver

selecting Help Install New Software... In the [Work with] field enter the BIRT update site url. http ... /update-site/4.6  (Eclipse Neon, Oxygen) and press ENTER. Click the Select All button to select ... ] dialog box by selecting Help Install New Software... In the [Work with] field enter the ObjectDB

Getting Started with JPA - Eclipse Project

: Select File Import... Maven Existing Maven Projects and click Next . Select the points-console directory as Root Directory and press ENTER . Select the project and click  Finish . Run the project in Eclipse: Right click the project node and select Run As Java Application . Select Main - point and click OK .

Step 2: Entity Class and Persistence Unit

) and selecting   New Class . Enter  guest as the package name - use  exactly that case ... node (in the [Project Explorer] window) and selecting New Folder (or  New Other... General Folder and clicking Next ). Select the project src folder as a parent folder, enter META-INF as a new

Java EE 6 JPA Tutorial - Eclipse Project

Eclipse: Select   File Import... Maven Existing Maven Projects and click  Next . Select the  guestbook-jee6 directory as Root Directory and press  ENTER . Select the project and click  Finish . Run the project in Eclipse: Right click the project node and select   Run As Run

Spring MVC JPA Tutorial - Eclipse Project

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-spring directory as Root Directory and press  ENTER . Select the project and click  Finish

Step 2: Entity Class and Persistence Unit

the project node (in the [Package Explorer] window), select   New Source Folder ... right clicking the new source directory node (in the [Package Explorer] window) and selecting   ... the [Project Explorer]) and select   New Folder. The parent folder should be resources. Enter META

Getting Started with JPA - NetBeans Project

NetBeans: Select File Open Project... . Select the points-console directory and click Open Project . Run the project in NetBeans: Select Run Run Main Project... (or F6 ). Click Select Main Class .

Getting Started with JPA - IntelliJ Project

IntelliJ IDEA: Select File Open Project... . Select the points-console directory and click Open Project . Run the project in IntelliJ IDEA: Select Run Run Main Project... (or F6 ). Click Select Main Class .

JPA Web App Tutorial - Eclipse Project

and extract the project zip file: JPA Web App - Maven Project (6KB) Open the Maven project in Eclipse: Select   File Import... Maven Existing Maven Projects and click  Next . Select the  guestbook-web directory as Root Directory and press  ENTER . Select the project and click  Finish

Step 1: Create a Java EE Web Project

] dialog box, e.g. by using File New Project... Select Java Web Web Application and click Next . Choose a Project Name (e.g. Guestbook ) and click Next . Select GlassFish Server 3 (or above)  ... ] window and select Add Jar/Folder... Select the objectdb.jar file from the bin subdirectory

Step 1: Create a Web Project

.g. by using File New Project... Select Java Web Web Application and click Next . Choose a Project Name (e.g. Guestbook ) and click Next . Select Apache Tomcat 6 as the Server. Note ... and select Add Jar/Folder... Select the objectdb.jar file from the bin subdirectory of the ObjectDB

JPA Web App Tutorial - NetBeans Project

: Select   File Open Project... . Select the  guestbook-web directory and click  Open Project . Run the project: Select Run Run Main Project... (or F6 ). Choose or define the server and click

Step 1: Create a Java Project

We start by creating a new NetBeans Project: Open the [New Project] dialog box, e.g. by using File New Project... Select Java Java Application and click Next . Choose a Project Name (e.g. Tutorial ... ] window and select Add Jar/Folder... Select the objectdb.jar file from the bin subdirectory

Step 7: Run the Spring Web App

), selecting   Run As Run on Server , selecting the Tomcat 6.0 server and clicking Finish ... Maven Jetty plugin: Right click the project node and select Run As Maven Build... Enter