Internal Website Search
1-50 of 200 resultsStrings in JPQL and Criteria Queries String values may appear in JPQL queries in various forms: as string literals - e.g. 'abc' , ''. as parameters - when string values are assigned as arguments. as path expressions - in navigation to persistent string fields. as results of predefined JPQL string manipulation functions | |
javax.persistence.DiscriminatorType.STRING JPA Enum Constant in javax.persistence.DiscriminatorType STRING String as the discriminator type. Since: JPA 1.0 | |
javax.persistence.EnumType.STRING JPA Enum Constant in javax.persistence.EnumType STRING Persist enumerated type property or field as a string . Since: JPA 1.0 | |
Query Parameters in JPA with different parameter values (arguments) is more efficient than using a new query string for every query ... getCountryByName( EntityManager em, String name) { TypedQuery query = em. createQuery ( "SELECT c FROM ... identified in a query string by their special form, which is a colon (:) followed by a valid JPQL | |
Index Definition; @Entity public class EntityWithSimpleIndex { @Index String indexedField1; @Index ( unique ="true") int ... .BigInteger , java.math.BigDecimal. java.lang. String . java.util.Date , java.sql.Date , java.sql.Time ... EntityWithCompositeIndex { String firstName; String lastName; } When indexed fields are specified | |
JPA Criteria API Queries JPQL JPQL queries are defined as strings , similarly to SQL. JPA criteria queries, on the other hand ... rather than at runtime. On the other hand, for many developers string based JPQL queries, which are very similar to SQL queries, are easier to use and understand. For simple static queries - string based JPQL | |
Literals in JPQL and Criteria Queries including NULL , boolean literals ( TRUE and FALSE ), numeric literals (e.g. 100 ), string literals ... literals (e.g. 077 , 077L ), a feature that is not currently supported by all JPA implementations. String Literals JPQL follows the syntax of SQL for string literals in which strings are always enclosed in | |
JPA Persistable Types, Mapped superclasses, Embeddable classes. Simple Java data types: Primitive types, Wrappers, String ... public class Address { String street; String city; String state; String country; String zip; } Instances ... . java.lang. String . java.util.Date , java.util.Calendar , java.sql.Date , java.sql.Time , java.sql | |
SELECT clause (JPQL / Criteria API) country names as String instances, rather than Country objects: SELECT c.name FROM Country AS c Using ... of the above query are received as a list of String values: TypedQuery query = em. createQuery ( "SELECT c.name FROM Country AS c", String .class); List results = query. getResultList (); Only singular | |
Database Explorer a query string . In the [Parameters] table provide arguments for parameters (if any). An entity ... Multi Line String command to edit a multi-line string . Reference fields can be edited using ... : The [Encoding] combo box is useful when strings in the database are not encoded using Unicode. ObjectDB | |
JPA Entity Fields { String name; @ManyToOne Department department; } @Entity public class Department { @OneToMany ... = id; } private String str; String getStr() { return str; } void setStr( String str) { this.str | |
JPA Queries interface) is the only neccessary interface for defining and running string based JPQL queries  ... ) can be done by concatenating JPQL strings into a valid complete JPQL query. JPA 2 introduced the JPA Criteria ... , and is equivalent to a JPQL query string (i.e. to a String instance containing JPQL). An essential | |
JPA Named Queries A named query is a statically defined query with a predefined unchangeable query string . Using ... query strings from the Java code. It also enforces the use of query parameters rather than embedding literals dynamically into the query string and results in more efficient queries. @NamedQuery | |
Posting Sample Code; public static void main( String [] args) {   ... { private String name; MyEntity( String name) {   | |
Defining a JPA Entity Class; } public int getY() { return this.y; } // String Representation: @Override public String toString() { return String .format("(%d, %d)", this.x, this.y); } } As you can see above, an entity class | |
JPA Query API and Named Queries Building queries by passing JPQL query strings directly to the createQuery method, as shown above, is referred to in JPA as dynamic query construction because the query string ... queries, based on Java objects that represent query elements (replacing string based JPQL). JPA | |
Comparison in JPQL and Criteria API by using any comparison operator. String values can be compared by using any comparison operator. Equality operators (=, , == , != ) on strings in queries follow the logic of Java's equals ... , a double value can be compared to a BigInteger instance but not to a String instance. [NOT] BETWEEN | |
Online Backup; em.createQuery("objectdb backup").getSingleResult(); The backup query string is always exactly ... , the backup target could be specified as a String value: Query backupQuery = em.createQuery("objectdb backup"); backupQuery.setParameter("target", "backup"); backupQuery.getSingleResult(); When a string | |
Paths and Types in JPQL and Criteria API, string , date). Simple type values are more useful in queries. They have special operators and functions (e.g. for strings and for numbers ), they can be compared by all six comparison operators ... types (number, boolean, string , date). For a path expression to be valid the user defined persistable | |
GROUP BY and HAVING clauses of comparable values (numeric, strings , dates). MAX - returns the maximum of comparable values (numeric, strings , dates). The following query counts for every letter the number of countries with names ... the initial letter as a String object, the second cell contains the number of countries in | |
Database Schema Evolution any type to String (using toString() if necessary). From String to numeric types including enum types | |
JPA Metamodel API only one additional method for getting the entity name: String entityName = entityType. getName ... details. For example: // Get the field (or property) name: String name = attr. getName (); // Get Java | |
ObjectDB Object Database Features. String Date types : java.util.Date, java.sql.Date, java.sql.Time and java.sql.Timestamp. Math types ... (Boolean, Byte, Short, Character, Integer, Long, Float and Double). java.lang. String Dates: java | |
Server Configuration. If another port is specified it also has to be specified by clients in the URL connection string | |
Collections in JPQL and Criteria Queries"); Expression param = cb. parameter ( String .class); // collection IS [NOT] EMPTY Predicate e1 = cb | |
JPA Query Expressions (JPQL / Criteria) , quot , mod , abs , neg , sqrt ). String expressions ( like , length , locate , lower , upper , concat | |
JPA Query Structure (JPQL / Criteria), string literals are also case sensitive (e.g. "ORM" and "orm" are different values). A Minimal JPQL | |
Numbers in JPQL and Criteria Queries functions - when the return value is numeric, e.g. INDEX, SIZE. as string functions - when the return | |
Retrieving JPA Entity Objects is hollow transparent activation occurs when it is first accessed. For example: String managerName | |
JPA Class Enhancer method as a single string delimited by commas or spaces. In addition, a class loader for loading | |
What are the main benefits of using ObjectDB? multiple values (even for a simple data structure such as a collection of strings ). In addition | |
WHERE clause (JPQL / Criteria API)) and functions (numeric functions, string functions, collection functions). The WHERE predicate | |
[ODB1] Chapter 7 - JDOQL Queries one of the following two newQuery( ... ) forms: Query newQuery(Extent candidates, String filter) Query newQuery(Class cls, String filter) In the first form, the candidate class is automatically set to the class ... collection, rather than an Extent : Query newQuery(Class cls, Collection candidates, String filter) Querying | |
[ODB1] Chapter 2 - A Quick Tour;Hello World The HelloWorld sample program manages a list of strings in the database. Each time the program is run another string is stored in the database and all the strings in the database are printed ... a list of two strings "Hello World 0" and "Hello World 1". Program Source Code The program consists | |
[ODB1] Chapter 6 - Persistent Objects reachability is applicable to all persistent types, including system types, such as String and ArrayList ... ObjectDB returns the numeric ID of the object as a string . The ability to convert Object IDs to strings , and the ability to convert strings back to object IDs (as shown in the next section), make object | |
Step 2: Entity Class and Persistence Unit String name; private Date signingDate; // Constructors: public Guest() { } public Guest( String name) { this.name = name; this.signingDate = new Date(System.currentTimeMillis()); } // String Representation: @Override public String toString() { return name + " (signed on " + signingDate | |
Step 2: Entity Class and Persistence Unit final long serialVersionUID = 1L; // Persistent Fields: @Id @GeneratedValue Long id; private String name; private Date signingDate; // Constructors: public Guest() { } public Guest( String name) { this.name = name; this.signingDate = new Date(System.currentTimeMillis()); } // String Representation | |
Step 2: Entity Class and Persistence Unit; private String name; private Date signingDate; // Constructors: public Guest() { } public Guest( String name) { this.name = name; this.signingDate = new Date(System.currentTimeMillis()); } // String Representation: @Override public String toString() { return name + " (signed on " + signingDate | |
Step 2: Entity Class and Persistence Unit final long serialVersionUID = 1L; // Persistent Fields: @Id @GeneratedValue Long id; private String name; private Date signingDate; // Constructors: public Guest() { } public Guest( String name) { this.name = name; this.signingDate = new Date(System.currentTimeMillis()); } // String Representation | |
Step 2: Define a JPA Entity Class String name; private Date signingDate; // Constructors: public Guest() { } public Guest( String name) { this.name = name; this.signingDate = new Date(System.currentTimeMillis()); } // String Representation: @Override public String toString() { return name + " (signed on " + signingDate + ")"; } }  | |
Step 2: Define a JPA Entity Class @GeneratedValue Long id; private String name; private Date signingDate; // Constructors: public Guest() { } public Guest( String name) { this.name = name; this.signingDate = new Date(System.currentTimeMillis()); } // String Representation: @Override public String toString() { return name + " (signed | |
[ODB1] Chapter 9 - ObjectDB Explorer are provided in the "Edit" menu and in the content menu. Use the "Edit Multi Line String " command to edit a multi line string . Use the "Set Reference" command to set a reference field to a new object ... " combo box should reflect the encoding of strings in the database. ObjectDB stores String instances in | |
[ODB1] Chapter 4 - JDO Metadata contains all the fields with primitive types (e.g. int), types defined in java.lang (e.g. String ... . Wrapper objects, strings , dates, collections and arrays are embedded by default. To use them as non ... . String field, empty collection, 0 size array, and so on). primary-key The primary-key attribute, defined | |
Step 2: Define a JPA Entity Class public String toString() { return String .format("(%d, %d)", this.x, this.y); } } The new class | |
Step 2: Define a JPA Entity Class() { return id; } public int getX() { return x; } public int getY() { return y; } @Override public String toString() { return String .format("(%d, %d)", this.x, this.y); } } The new class should represent Point | |
JDO Predefined ID Classes, to use a String primary key define a primary key field of type String : @PersistenceCapable public class MyClass { @PrimaryKey String id; } Persistent objects with a String primary key (including instances of MyClass ) can be represented uniquely by StringIdentity , as a combination of a class and a string value. | |
Step 4: Add a Controller Class") public ModelAndView guestbook(HttpServletRequest request) { // Handle a new guest (if any): String | |
Step 4: Add a Servlet Class a new guest (if any): String name = request.getParameter("name"); if (name != null) { em | |
[ODB1] Chapter 8 - ObjectDB Server the connection URL string . 8.1 Running an ObjectDB Server The ObjectDB server is a pure Java ... string (as explained in section 5.1 ) when connecting to the database. The reload attribute specifies ... connection string "objectdb://localhost/my/db.odb" refers to a database file db.odb in | |
[ODB1] Chapter 3 - Persistent Classes , Character , Integer , Long , Float , Double , Number and String . Selected classes in package java ... class eMain { public static void main( String [] args) { // Always start by calling the enhancer: com ... method accepts as an argument a string specifying the classes to be enhanced. The syntax is adopted |