ObjectDB Database Search
1-50 of 200 resultsjakarta.persistence.criteria.CriteriaBuilder.substring(Expression,int,int) Jakarta Persistence (JPA) Method in jakarta.persistence.criteria.CriteriaBuilder Expression substring ( Expression x , int from , int len ) Create an expression for substring extraction. Extracts a substring of given length starting at the specified position | |
jakarta.persistence.TypedQuery.setFirstResult(int) Jakarta Persistence (JPA) Method in jakarta.persistence.TypedQuery TypedQuery setFirstResult ( int startPosition ) Set the position of the first result to retrieve. Parameters: startPosition - position of the first result, numbered from 0 Returns: the same query instance. Throws | |
jakarta.persistence.TypedQuery.setParameter(int,Object) Jakarta Persistence (JPA) Method in jakarta.persistence.TypedQuery TypedQuery setParameter ( int position , Object value ) Bind an argument value to a positional parameter. Parameters: position - position value - parameter value Returns: the same query instance. Throws | |
jakarta.persistence.TypedQuery.setParameter(int,Calendar,TemporalType) Jakarta Persistence (JPA) Method in jakarta.persistence.TypedQuery TypedQuery setParameter ( int position , Calendar value , TemporalType temporalType ) Bind an instance of Calendar to a positional parameter. Parameters: position - position temporalType | |
jakarta.persistence.TypedQuery.setParameter(int,Date,TemporalType) Jakarta Persistence (JPA) Method in jakarta.persistence.TypedQuery TypedQuery setParameter ( int position , Date value , TemporalType temporalType ) Bind an instance of Date to a positional parameter. Parameters: position - position temporalType - temporal | |
jakarta.persistence.Timeout.s(int) Jakarta Persistence (JPA) Method in jakarta.persistence.Timeout Timeout s ( int seconds ) Specify a timeout in seconds. (Abbreviation of Timeout.seconds .) Since: Jakarta Persistence (JPA) 1.0 | |
jakarta.persistence.Timeout.ms(int) Jakarta Persistence (JPA) Method in jakarta.persistence.Timeout Timeout ms ( int milliseconds ) Specify a timeout in milliseconds. (Abbreviation of Timeout.milliseconds .) Since: Jakarta Persistence (JPA) 1.0 | |
jakarta.persistence.Timeout.seconds(int) Jakarta Persistence (JPA) Method in jakarta.persistence.Timeout Timeout seconds ( int seconds ) Specify a timeout in seconds. Since: Jakarta Persistence (JPA) 1.0 | |
jakarta.persistence.Tuple.get(int,Class) Jakarta Persistence (JPA) Method in jakarta.persistence.Tuple X get ( int i , Class type ) Get the value of the element at the specified position in the result tuple. The first position is 0. Parameters: i - position in result tuple type - type of the tuple element | |
jakarta.persistence.Tuple.get(int) Jakarta Persistence (JPA) Method in jakarta.persistence.Tuple Object get ( int i ) Get the value of the element at the specified position in the result tuple. The first position is 0. Parameters: i - position in result tuple Returns: value of the tuple element. Throws | |
jakarta.persistence.Timeout.milliseconds(int) Jakarta Persistence (JPA) Method in jakarta.persistence.Timeout Timeout milliseconds ( int milliseconds ) Specify a timeout in milliseconds. Since: Jakarta Persistence (JPA) 1.0 | |
jakarta.persistence.TypedQuery.setMaxResults(int) Jakarta Persistence (JPA) Method in jakarta.persistence.TypedQuery TypedQuery setMaxResults ( int maxResult ) Set the maximum number of results to retrieve. Parameters: maxResult - maximum number of results to retrieve Returns: the same query instance. Throws: IllegalArgumentException | |
jakarta.persistence.StoredProcedureQuery.setParameter(int,Object) Jakarta Persistence (JPA) Method in jakarta.persistence.StoredProcedureQuery StoredProcedureQuery setParameter ( int position , Object value ) Bind an argument value to a positional parameter. Parameters: position - position value - parameter value Returns: the same query | |
jakarta.persistence.StoredProcedureQuery.setParameter(int,Calendar,TemporalType) Jakarta Persistence (JPA) Method in jakarta.persistence.StoredProcedureQuery StoredProcedureQuery setParameter ( int position , Calendar value , TemporalType temporalType ) Bind an instance of java.util.Calendar to a positional parameter. Parameters: position | |
jakarta.persistence.StoredProcedureQuery.setParameter(int,Date,TemporalType) Jakarta Persistence (JPA) Method in jakarta.persistence.StoredProcedureQuery StoredProcedureQuery setParameter ( int position , Date value , TemporalType temporalType ) Bind an instance of java.util.Date to a positional parameter. Parameters: position | |
jakarta.persistence.StoredProcedureQuery.getOutputParameterValue(int) Jakarta Persistence (JPA) Method in jakarta.persistence.StoredProcedureQuery Object getOutputParameterValue ( int position ) Retrieve a value passed back from the procedure through an INOUT or OUT parameter. For portability, all results corresponding to result sets and update counts | |
jakarta.persistence.StoredProcedureQuery.registerStoredProcedureParameter(int,Class,ParameterMode) Jakarta Persistence (JPA) Method in jakarta.persistence.StoredProcedureQuery StoredProcedureQuery registerStoredProcedureParameter ( int position , Class type , ParameterMode mode ) Register a positional parameter. All parameters must be registered | |
jakarta.persistence.Timeout.Timeout(int) Jakarta Persistence (JPA) Constructor in jakarta.persistence.Timeout Timeout ( int milliseconds ) Since: Jakarta Persistence (JPA) 1.0 | |
jakarta.persistence.criteria.CriteriaBuilder.substring(Expression,int) Jakarta Persistence (JPA) Method in jakarta.persistence.criteria.CriteriaBuilder Expression substring ( Expression x , int from ) Create an expression for substring extraction. Extracts a substring starting at the specified position through to end of the string. First | |
jakarta.persistence.criteria.CriteriaBuilder.left(Expression,int) Jakarta Persistence (JPA) Method in jakarta.persistence.criteria.CriteriaBuilder Expression left ( Expression x , int len ) Create an expression for the leftmost substring of a string, Parameters: x - string expression len - length of the substring to return Returns | |
jakarta.persistence.criteria.CriteriaBuilder.right(Expression,int) Jakarta Persistence (JPA) Method in jakarta.persistence.criteria.CriteriaBuilder Expression right ( Expression x , int len ) Create an expression for the rightmost substring of a string, Parameters: x - string expression len - length of the substring to return Returns | |
jakarta.persistence.Query.setParameter(int,Date,TemporalType) Jakarta Persistence (JPA) Method in jakarta.persistence.Query Query setParameter ( int position , Date value , TemporalType temporalType ) Bind an instance of Date to a positional parameter. Parameters: position - position temporalType - temporal type value | |
jakarta.persistence.Query.setParameter(int,Object) Jakarta Persistence (JPA) Method in jakarta.persistence.Query Query setParameter ( int position , Object value ) Bind an argument value to a positional parameter. Parameters: position - position value - parameter value Returns: the same query instance. Throws | |
jakarta.persistence.Query.setParameter(int,Calendar,TemporalType) Jakarta Persistence (JPA) Method in jakarta.persistence.Query Query setParameter ( int position , Calendar value , TemporalType temporalType ) Bind an instance of Calendar to a positional parameter. Parameters: position - position temporalType - temporal type | |
jakarta.persistence.Query.getParameterValue(int) Jakarta Persistence (JPA) Method in jakarta.persistence.Query Object getParameterValue ( int position ) Return the input value bound to the positional parameter. (Note that OUT parameters are unbound.) Parameters: position - position Returns: parameter value. Throws | |
jakarta.persistence.Query.getParameter(int) Jakarta Persistence (JPA) Method in jakarta.persistence.Query Parameter getParameter ( int position ) Get the parameter object corresponding to the declared positional parameter with the given position. This method is not required to be supported for native queries. Parameters | |
jakarta.persistence.Query.getParameter(int,Class) Jakarta Persistence (JPA) Method in jakarta.persistence.Query Parameter getParameter ( int position , Class type ) Get the parameter object corresponding to the declared positional parameter with the given position and type. This method is not required to be supported by | |
jakarta.persistence.Query.setMaxResults(int) Jakarta Persistence (JPA) Method in jakarta.persistence.Query Query setMaxResults ( int maxResult ) Set the maximum number of results to retrieve. Parameters: maxResult - maximum number of results to retrieve Returns: the same query instance. Throws: IllegalArgumentException | |
jakarta.persistence.criteria.CriteriaBuilder.locate(Expression,String,int) Jakarta Persistence (JPA) Method in jakarta.persistence.criteria.CriteriaBuilder Expression locate ( Expression x , String pattern , int from ) Create expression to locate the position of one string within another, returning position of first character | |
jakarta.persistence.Query.setFirstResult(int) Jakarta Persistence (JPA) Method in jakarta.persistence.Query Query setFirstResult ( int startPosition ) Set the position of the first result to retrieve. Parameters: startPosition - position of the first result, numbered from 0 Returns: the same query instance. Throws | |
JPA Entity Fields annotation (which affects only persistence): @Entity public class EntityWithTransientFields { static int transient1; // not persistent because of static final int transient2 = 0; // not persistent because of final transient int transient3; // not persistent because of transient @Transient int transient4 | |
Defining a JPA Entity Class.persistence.Entity; @Entity public class Point { // Persistent Fields: private int x; private int y; // Constructor: Point ( int x, int y) { this.x = x; this.y = y; } // Accessor Methods: public int getX() { return this.x; } public int getY() { return this.y; } // String Representation: @Override public | |
JPA Primary Key field can have one of the following types: Primitive types: boolean , byte , short , char , int ... consists of two fields: @Entity @IdClass (ProjectId.class) public class Project { @Id int ... ProjectId { int departmentId; long projectId; } ObjectDB does not require you to define an ID class | |
Index Definition class EntityWithSimpleIndex { @Index String indexedField1; @Index ( unique ="true") int indexedField2; // unique @Index ( name ="i3") int indexedField3; @Unique Integer indexedField4; // unique @Unique ... of one of the following persistable types: Primitive types: boolean , byte , short , char , int | |
Numbers in JPQL and Criteria Queries numeric promotion principles. For example, the result of a binary arithmetic operation on an int value ... , if the operands are an int and a long , the MOD function returns a long . The SQRT function The SQRT ... byte , short , int , long , float , double , BigInteger , and BigDecimal . Unary Operators Creating | |
Database Schema Evolution to the new type (for example, a change from int to Date ), the fields are not considered matching ... types are: byte , short , char , int , long , float , double , Byte , Short , Character , Integer ... , as long as the elements are convertible (for example, from int [] to ArrayList ). From any object | |
Download and Run Download and Run @Entity record Point( int x, int y) { } | |
Running JPA Queries, the following query deletes all Country instances: int count = em. createQuery ("DELETE FROM ... : int count = em. createQuery ("UPDATE Country SET area = 0"). executeUpdate | |
ObjectDB Object Database Features (for persistent fields) Primitive types (boolean, byte, short, char, int , long, float, double). Wrapper ... Types Primitives (boolean, byte, short, char, int , long, float and double). Wrappers (Boolean, Byte | |
jakarta.persistence.StoredProcedureQuery timeout value set and only the statement is rolled back. Since: Jakarta Persistence (JPA) 1.0 int ... execution. Inherited from Query Since: Jakarta Persistence (JPA) 3.2 int getFirstResult () The position ... Persistence (JPA) 2.0 int getMaxResults () The maximum number of results the query object was set | |
Storing JPA Entities the clear and flush methods together to save memory during large transactions: em. getTransaction (). begin (); for ( int i = 1; i | |
Strings in JPQL and Criteria Queries the string argument as an int . For example: LENGTH('United States') is evaluated to 13 . LENGTH('China | |
JPA Persistable Types data types are persistable: Primitive types: boolean , byte , short , char , int , long , float | |
DELETE Queries in JPA/JPQL DELETE queries are executed using the executeUpdate method: int deletedCount = em. createQuery | |
Literals in JPQL and Criteria Queries. The following are examples of valid numeric literals in JPQL: int : 100, -127, 0, 07777 long : 100L | |
CRUD Database Operations with JPA Given an EntityManager instance, em , which manages the persistence context for the database, you can use it to store, retrieve, update, and delete objects. Storing new entities The following code fragment stores 1,000 Point objects in the database: em. getTransaction (). begin (); for ( int i = 0 | |
Step 2: Define a JPA Entity Class; private int x; private int y; public Point() { } Point( int x, int y) { this.x = x; this.y = y; } public Long getId() { return id; } public int getX() { return x; } public int getY() { return y; } @Override | |
Step 2: Define a JPA Entity Class static final long serialVersionUID = 1L; @Id @GeneratedValue private long id; private int x; private int y; public Point() { } Point( int x, int y) { this.x = x; this.y = y; } public Long getId() { return id; } public int getX() { return x; } public int getY() { return y; } @Override public String | |
Step 3: Add a Main Class = emf.createEntityManager(); // Store 1000 Point objects in the database: em.getTransaction().begin(); for ( int i = 0; i | |
Step 3: Add a Main Class.createEntityManager(); // Store 1000 Point objects in the database: em.getTransaction().begin(); for ( int i = 0; i |