ObjectDB Database Search

1-50 of 171 results

SELECT clause (JPQL / Criteria API)

query = em. createQuery (" SELECT c FROM Country c", Country.class); List results = query ... expression in SELECT clauses. Specifying the required query results more precisely can improve ... must always be specified explicitly. JPQL does not support the the SELECT * expression, which is common in SQL

jakarta.persistence.criteria.CriteriaBuilder.tuple(Selection...)

tuple (    Selection ... selections ) Create a tuple-valued selection item. Parameters: selections - selection items Returns: tuple-valued compound selection . Throws: IllegalArgumentException - if an argument is a tuple- or array-valued selection item. Since: Jakarta Persistence (JPA) 1.0

jakarta.persistence.criteria.CriteriaBuilder.array(Selection...)

array (    Selection ... selections ) Create an array-valued selection item. Parameters: selections - selection items Returns: array-valued compound selection . Throws: IllegalArgumentException - if an argument is a tuple- or array-valued selection item. Since: Jakarta Persistence (JPA) 1.0

jakarta.persistence.criteria.CriteriaBuilder.construct(Class,Selection...)

construct (    Class resultClass ,    Selection ... selections ) Create a selection item corresponding to a constructor. This method is used to specify a constructor ... entities will be in the new state after the query is executed. Parameters: selections - arguments

jakarta.persistence.criteria.Selection.getCompoundSelectionItems()

Jakarta Persistence (JPA) Method in jakarta.persistence.criteria. Selection List getCompoundSelectionItems() Return the selection items composing a compound selection . Modifications to the list do not affect the query. Returns: list of selection items. Throws: IllegalStateException - if selection

jakarta.persistence.criteria.Selection.alias(String)

Jakarta Persistence (JPA) Method in jakarta.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 Returns: selection item. Since: Jakarta Persistence (JPA) 1.0

jakarta.persistence.criteria.Selection.isCompoundSelection()

Jakarta Persistence (JPA) Method in jakarta.persistence.criteria. Selection boolean isCompoundSelection() Whether the selection item is a compound selection . Returns: boolean indicating whether the selection is a compound selection . Since: Jakarta Persistence (JPA) 1.0

jakarta.persistence.criteria.Subquery.select(Expression)

Jakarta Persistence (JPA) Method in jakarta.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

FROM clause (JPQL / Criteria API)

the following query, c iterates 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 ... . For example, the following query returns all pairs of countries that share a common border: SELECT c1

Problem with distinct select, order by and equivalent alias/attribute path

;  String q1 = " select distinct s_location "          ... ;   q1 = " select distinct s.location "          ... ;   String q2 = " select distinct s.location "        

Multi selection and distinct in a criteria query

hi, How can I realize multi selection with the criteria api concerning distinct? I.e. doing something like SELECT DISTINCT $1, $2 wouldn't work because I do only have something like criteria.multiselect(...) and nothing like builder.distinct( selection ) so that I could do something like criteria

Is there any faster select method?

SELECT : TypedQuery query = em.createQuery(     " SELECT p FROM Point p WHERE p ... ); ** the Point class is of the tutorial. I found the above select method is ten times slower ... . Is there any faster method of select ? TIA pikotenta pikotenta Entity objects can be retrieved by

selecting objects that have a particular key/value in persistant HashMap

create a JPA query that selects such objects?  Something like the following (but clearly does not work) :  SELECT p FROM Person p where p.pMap['location']='California' Any thoughts?  Thanks, -Adam   adamMc Adam Please try the following query: SELECT p FROM Person p WHERE p.pMap

Selecting random rows

Hello is there way to get random rows? Functions like rand(), random(), newid() doesn't work ;/ for example: em.createQuery(" SELECT s FROM StawkaVat s ORDER BY rand()").setMaxResults(5).getResultList(); gives exception: Exception in thread "AWT-EventQueue-0" [ObjectDB 2.5.6_02] SELECT s FROM StawkaVat s == rand

Conditional Selection

so when I use... SELECT firstName + " " + middleName + " " + lastName FROM Employee     ... an additional field. e.g. displayName . Use a method in the SELECT clause. It could be a static method

Performance in SELECT statement

) Example query looks like : String strSelect = " SELECT e FROM TestEntity WHERE e.state.entityState IN

Unexpected query token 'delete' (SELECT is expected) (error 752)

simple codes(see attachment), failed.   gzdillon Lai Yang DELETE queries should not be run with getSingleResult ( which is for SELECT queries). Use executeUpdate instead. See this manual page . support Support

Index Definition

them to accelerate query execution. Indexes are especially efficient for lookup 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 ... . ObjectDB also uses indexes for sorting results and for projection: SELECT MIN(p.x) FROM Point p WHERE p.x

JPA Criteria Query Expressions

and selections , enabling the construction of dynamic, type-safe queries. These interfaces represent ... interfaces is structured as follows: Selection # Base interface for result items └─ Expression # Base ... , representing any typed value, calculation, or path within the query. Extends Selection  

Logical Operators in JPQL and Criteria API

and area exceed specified limits: SELECT c FROM Country c WHERE c.population :population AND c.area ... a specified limit: SELECT c FROM Country c WHERE c.population :population OR c.area :area Valid operands ... The following query retrieves all countries whose population does not exceed a specified limit: SELECT c FROM

JPA Entity Fields

the following query, where :d represents the Department entity: SELECT e FROM Employee e WHERE e.department ... this case, the employees field is populated with the results of the following query: SELECT e FROM

Setting and Tuning of JPA Queries

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

JPA Query Expressions (JPQL / Criteria)

JPQL and criteria queries are built on query expressions. Every query consists of clauses , such as SELECT , FROM , WHERE , GROUP BY , HAVING , and ORDER BY . Each clause is composed of JPQL or Criteria API expressions. Atomic expressions The atomic query expressions are: JPQL / Criteria Variables

jakarta.persistence.EntityResult

the SELECT clause of a SQL query to an entity result. If this annotation is used, the SQL statement should select all the columns that are mapped to the entity object. This should include foreign key ... . Example: Query q = em.createNativeQuery( " SELECT o.id, o.quantity, o.item, " + "i.id, i.name, i

jakarta.persistence.ColumnResult

ConstructorResult annotation to map a column of the SELECT list of a SQL query. The name element references the name of a column in the SELECT list — i.e., column alias, if applicable. Scalar result types ... .createNativeQuery( " SELECT o.id AS order_id, " + "o.quantity AS order_quantity, " + "o.item AS

jakarta.persistence.EntityManager

for executing a Jakarta Persistence query language named query. The select list of the query ... if there is only one column in the select list.) Column values are returned in the order of their occurrence in the select list and default JDBC type mappings are applied. Parameters: sqlString - a native

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

jakarta.persistence.criteria.CriteriaBuilder.tuple(List)

tuple (    List selections ) Create a tuple-valued selection item. Parameters: selections - list of selection items Returns: tuple-valued compound selection . Throws: IllegalArgumentException - if an argument is a tuple- or array-valued selection item. Since: Jakarta Persistence (JPA) 3.2

jakarta.persistence.criteria.CriteriaBuilder.array(List)

array (    List selections ) Create an array-valued selection item. Parameters: selections - list of selection items Returns: array-valued compound selection . Throws: IllegalArgumentException - if an argument is a tuple- or array-valued selection item. Since: Jakarta Persistence (JPA) 3.2

jakarta.persistence.ConstructorResult

to map the SELECT clause of a SQL query to a constructor. Applies a constructor for the target class ... is retrieved for the constructed object. Example: Query q = em.createNativeQuery( " SELECT c.id, c.name ... ColumnResult[] columns (Required) The mapping of columns in the SELECT list to the arguments

jakarta.persistence.FieldResult

the SELECT list of a SQL query to the properties or fields of an entity class. Example: Query q = em.createNativeQuery( " SELECT o.id AS order_id, " + "o.quantity AS order_quantity, " + "o.item AS order_item ... column Name of the column in the SELECT clause - i.e., column aliases, if applicable. Since: Jakarta

jakarta.persistence.criteria.AbstractQuery.getSelection()

Jakarta Persistence (JPA) Method in jakarta.persistence.criteria.AbstractQuery Selection getSelection() Return the selection of the query, or null if no selection has been set. Returns: selection item. Since: Jakarta Persistence (JPA) 1.0

jakarta.persistence.ForeignKey

. If this annotation is not specified, a default foreign key strategy is selected by the persistence ... .PROVIDER_DEFAULT selects the default behavior of the provider, which may or may not result in

jakarta.persistence.JoinTable

, a default foreign key strategy is selected by the persistence provider. Default: @ForeignKey ... strategy is selected by the persistence provider. Default: @ForeignKey(ConstraintMode.PROVIDER_DEFAULT

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

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 

Step 6: Set the Spring XML

editor (by right clicking and selecting   Open With Text Editor or by double click ... that file: Right click the WEB-INF node in the [Package Explorer] window, select   New Other... XML

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 ... of guests: List guestList = em.createQuery( " SELECT g FROM Guest g", Guest.class).getResultList

Step 3: Add a Context Listener Class

by right clicking the guest package node (in the [Package Explorer] window), selecting New ... the class name - use exactly that case sensitive class name. Click Next and then Select All to enable

Step 1: Create a Maven Web Project

We start by creating a new Maven-WTP dynamic web project in Eclipse: Open the [New Project] dialog box, e.g. by using  File New Project... Select   Maven Maven Project and click  ... ; maven-archetype-webapp as a filter, select   maven-archetype-webapp in the artifact list and click

Step 6: Set the Spring XML

clicking and selecting Edit or by double click and then moving to the XML tab in the editor window ... , select New Other... and then choose the XML category, XML Document and click Next . Enter spring

Step 1: Create a Maven Web Project

We start by creating a new Maven web project in NetBeans: Open the [New Project] dialog box, e.g. by using File New Project... Select Maven Maven Web Application and click Next . Choose a Project Name (e.g. Guestbook ) and select Java EE 5. Enter Maven Group Id (e.g. com.objectdb.tutorial.spring

Step 1: Create a Java EE 6 Web Project

We start by creating a new Java EE dynamic web project in Eclipse: 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 GlassFish Server Open Source Edition 3 (Java EE 6) as the Target

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