Internal Website Search

1-10 of 200 resultsRefresh

JPA Named Queries

A named query is a statically defined query with a predefined unchangeable query string. Using named queries instead of dynamic queries may improve code organization by separating the JPQL ... whose name is  "Country.findAll" that retrieves all the  Country objects in the database

SELECT clause (JPQL / Criteria API)

country names as String instances, rather than Country objects: SELECT c. name FROM Country AS c Using path expressions , such as c. name , in query results is referred to as projection. The field values ... c. name FROM Country AS c", String.class); List results = query. getResultList (); Only singular

Query Parameters in JPA

execution, because it eliminates the need for repeated query compilations. Named Parameters (: name ) The following method retrieves a Country object from the database by its name : public Country getCountryByName( EntityManager em, String name ) { TypedQuery query = em. createQuery ( "SELECT c FROM

Schema Update

... ... A element has two roles: If the optional new- name attribute is specified, the package name is changed from the original name , which is specified by the required name attribute, to the new name . All the classes in that package are moved to the new package name . In addition, whether or not a new

FROM clause (JPQL / Criteria API)

, and the same query can also be written as follows: SELECT c FROM Country c By default, the name of an entity class in a JPQL query is the unqualified name of the class (e.g. just Country with no package name ). The default name can be overridden by specifying another name explicitly in the @Entity 's

ORDER BY clause (JPQL / Criteria API)

Expressions The following query returns names of countries whose population size is at least one million people, ordered by the country name : SELECT c. name FROM Country c WHERE c.population 1000000 ORDER BY c. name When an ORDER BY clause exists it is the last to be executed. First the FROM clause

JPA Persistable Types

, package or private) and it can be either concrete or abstract. Entity Class Names Entity classes are represented in queries by entity names . By default, the entity name is the unqualified name of the entity class (i.e. the short class name excluding the package name ). A different entity name

Step 2: Entity Class and Persistence Unit

, enter src/main/java as Folder Name and click Finish . Open the [New Java Class] dialog box, e.g. by ... ; New Class . Enter  guest as the package name - use  exactly that case sensitive package name . Enter  Guest as the class name - use  exactly that case sensitive class name . Click

[ODB1] Chapter 6 - Persistent Objects

the assignment of names to objects in the database and the storing of instances of any persistent type ... object). 6.2  Object IDs and Names Identifying database objects by unique IDs and by names ... . The second method, object names , is not supported by JDO, but ObjectDB supports it as an extension

[ODB1] Chapter 2 - A Quick Tour

ArrayList list; 18 try { 19 // Retrieve the list from the database by its name : 20 list = (ArrayList ... the database by its name "Hello World" using the getObjectById( ... ) method (line 20 ... to the database with the name "Hello World", using the Utilities.bind( ... ) static method (line 25