ObjectDB Database Search
1-50 of 200 resultsHow to convert a boolean to an int in the query? How to convert a boolean to an int in the query? I have five parameters of type boolean in ... for your help galandor Orlov Sergey Consider adding an int field to your entity class, that will sum them. You can calculate it in a JPA lifecycle event . Currently you cannot convert boolean to int in | |
JPA Entity Fields (which only affects 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; // not | |
Defining a JPA Entity Class; @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 String toString | |
JPA Primary Key , char , int , long , float , double . Equivalent wrapper classes from package java.lang: Byte ... (ProjectId.class) public class Project { @Id int departmentId; @Id long projectId; : } When an entity ... can represent primary key values: public class ProjectId { int departmentId; long projectId | |
Database Schema Evolution from int to Date ) the fields are not considered as matching and the new field is initialized ... type to any numeric type. In this context numeric types are: byte , short , char , int , long ... collection or array type, as long as the elements are convertible (e.g. from int [] to ArrayList | |
Index Definition; @Entity public class EntityWithSimpleIndex { @Index String indexedField1; @Index ( unique ="true") int indexedField2; // unique @Index ( name ="i3") int indexedField3; @Unique Integer indexedField4 ... : Primitive types: boolean , byte , short , char , int , long , float , double. Equivalent wrapper | |
Numbers in JPQL and Criteria Queries of a binary arithmetic operation on an int value and a double value is double . The ABS Function The ABS ... is used as with binary arithmetic operations in Java (e.g. for int and long operands the MOD  ... demonstrate only integer expressions, but all the numeric types ( byte , short , int , long , float | |
ObjectDB Object Database Features System Types (for persistent fields) Primitive types (boolean, byte, short, char, int , long, float ... . Primary Key Data Types Primitives (boolean, byte, short, char, int , long, float and double). Wrappers | |
Running JPA Queries method. For example, the following query deletes all the Country instances: int count = em ... all the Country instances to zero: int count = em. createQuery ("UPDATE Country SET area = 0 | |
Storing JPA Entity Objects transactions: em. getTransaction (). begin (); for ( int i = 1; i | |
JPA Persistable Types , byte , short , char , int , long , float and double . Equivalent wrapper classes from package java | |
CRUD Database Operations with JPA (); for ( int i = 0; i = 100) { em. remove (p); // delete entity } else { p.setX(p.getX() + 100); // update | |
Query Parameters in JPA (); } The form of ordinal parameters is a question mark (?) followed by a positive int number. Apart from | |
Literals in JPQL and Criteria Queries ) are also supported. Following are examples of valid numeric literals in JPQL: int : 100, -127, 0, 07777 long | |
Strings in JPQL and Criteria Queries returns the number of characters in the argument string as an int . For example: LENGTH('United | |
Chapter 1 - Quick Tour that contains points in the plane. Each point is represented by an object with two int fields, x and y | |
UPDATE SET Queries in JPA/JPQL;"UPDATE Country SET population = 0, area = 0"); int updateCount = em. executeUpdate | |
DELETE Queries in JPA/JPQL the executeUpdate method: int deletedCount = em. createQuery ("DELETE FROM Country | |
Comparison in JPQL and Criteria API, including primitive types ( byte , short , char , int , long , float , double ), wrapper types ( Byte | |
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 | |
javax.persistence.StoredProcedureQuery.1 int executeUpdate () Return the update count of -1 if there is no pending result or if the first ... exceeds the query timeout value set and the transaction is rolled back Since: JPA 2.1 int getFirstResult ... query Inherited from: Query Since: JPA 2.0 int getMaxResults () The maximum number of results | |
javax.persistence.Query . Public Methods int executeUpdate () Execute an update or delete statement. Return: the number ... is rolled back Since: JPA 1.0 int getFirstResult () The position of the first result the query object ... int getMaxResults () The maximum number of results the query object was set to retrieve. Returns | |
javax.persistence.TypedQuery - JPA Queries (JPQL / Criteria) explains how to use TypedQuery . Public Methods int executeUpdate ... Since: JPA 1.0 int getFirstResult () The position of the first result the query object was set ... SELECT query or a Criteria API query Inherited from: Query Since: JPA 2.0 int getMaxResults | |
[ODB1] Chapter 7 - JDOQL Queries if the field exists but its type cannot be compared with an int value, a JDOUserException is thrown ... objects can be obtained using the size() method: int count = result.size(); Iteration over the result ... class contains a field with the name age and a type comparable to int . This section describes | |
[ODB1] Chapter 3 - Persistent Classes , int , long , float and double . Selected classes in package java.lang : Boolean , Byte , Short ... fields of types like int [] or Object[] ). Any class in which a persistent array is modified ... type is valid in Java (for example from int to float and from float to int ) the old value | |
javax.persistence.MapKeyClass and vice versa. Example 1: @Entity public class Item { @Id int id; ... @ElementCollection ... Item { @Id int id; ... @ElementCollection Map images; ... } Example 3: @Entity public class Company { @Id int id; ... @OneToMany(targetEntity=com.example.VicePresident.class) @MapKeyClass(com.example | |
javax.persistence.MapKeyColumn field or property; "_"; "KEY". Example: @Entity public class Item { @Id int id; ... @ElementCollection ... statements generated by the persistence provider. Since: JPA 2.0 int length default 255 (Optional) The column ... (Optional) Whether the database column is nullable. Since: JPA 2.0 int precision default 0 (Optional | |
javax.persistence.TableGenerator", allocationSize=1) @Id @GeneratedValue(strategy=TABLE, generator="empGen") int id; ... } Example 2 ... , generator="addressGen") int id; ... } See Also: GeneratedValue Since: JPA 1.0 The Auto Generated Values article explains how to use TableGenerator . Public Annotation Attributes int allocationSize default | |
javax.persistence.criteria.CriteriaBuilder;pattern, int from) Create expression to locate the position of one string ... to substring extraction Since: JPA 2.0 Expression substring ( Expression x, int from) Create ... ( Expression x, int from, int len) Create an expression for substring | |
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 | |
javax.persistence.Column is included in SQL INSERT statements generated by the persistence provider. Since: JPA 1.0 int ... is nullable. Since: JPA 1.0 int precision default 0 (Optional) The precision for a decimal (exact numeric ... when generating the DDL for the column. Since: JPA 1.0 int scale default 0 (Optional) The scale for a decimal | |
javax.persistence.MapKeyJoinColumn public class Company { @Id int id; ... @OneToMany // unidirectional @JoinTable(name="COMPANY ... VideoStore { @Id int id; String name; Address location; ... @ElementCollection @CollectionTable(name ... id; String title; ... } Example 3: @Entity public class Student { @Id int studentId; ... @ManyToMany | |
javax.persistence.OneToOne: One-to-one association from an embeddable class to another entity. @Entity public class Employee { @Id int id; @Embedded LocationDetails location; ... } @Embeddable public class LocationDetails { int officeNumber; @OneToOne ParkingSpot parkingSpot; ... } @Entity public class ParkingSpot { @Id int id; String garage | |
javax.persistence.AssociationOverride in the ContactInfo class @Entity public class Employee { @Id int id; @AssociationOverride( name ... .class) List phoneNumbers; } @Entity public class PhoneNumber { @Id int number; @ManyToMany(mappedBy | |
javax.persistence.ManyToOne getCustomer() { return customer; } Example 2: @Entity public class Employee { @Id int id; @Embedded JobInfo ... ; // Bidirectional } @Entity public class ProgramManager { @Id int id; @OneToMany(mappedBy="jobInfo | |
javax.persistence.SequenceGenerator Attributes int allocationSize default 50 (Optional) The amount to increment by when allocating ... of the sequence generator. Since: JPA 2.0 int initialValue default 1 (Optional) The value from | |
javax.persistence.Tuple correspond to an element in the query result tuple Since: JPA 2.0 Object get ( int i) Get the value ... - if i exceeds length of result tuple Since: JPA 2.0 X get ( int i, Class type | |
javax.persistence.Version other than the primary table will not be portable. The following types are supported for version properties: int ... ") protected int getVersionNum() { return versionNum; } Since: JPA 1.0 The JPA Entity Fields article | |
[ODB1] Chapter 2 - A Quick Tour lastName; 8 private int age; 9 10 // Constructors: 11 public Person() {} 12 public Person(String firstName, String lastName, int age) { 13 this.firstName = firstName; 14 this.lastName = lastName; 15 | |
[ODB1] Chapter 4 - JDO Metadata contains all the fields with primitive types (e.g. int ), types defined in java.lang (e.g. String ... : embedded value types: primitive type ( boolean , byte , short , char , int , long , float or double | |
javax.jdo.spi.StateManager boolean getBooleanField (PersistenceCapable pc, int field, boolean  ... Since: JDO 1.0 byte getByteField (PersistenceCapable pc, int field, byte  ... for the field Since: JDO 1.0 char getCharField (PersistenceCapable pc, int field, char | |
javax.jdo.spi.PersistenceCapable Public Methods void jdoCopyFields (Object other, int [] fieldNumbers) Copy field values ... ( int id, String name, and Float salary) would have the method generated: void ... key field in the ObjectId. For example, an ObjectId class that has three key fields ( int id, String | |
javax.jdo.FetchPlan leaving no active fetch group. Return: the FetchPlan Since: JDO 2.0 int getDetachmentOptions ... int getFetchSize () Return the fetch size, or FETCH_SIZE_OPTIMAL if not set, or FETCH_SIZE_GREEDY ... of all currently active fetch groups Since: JDO 2.0 int getMaxFetchDepth () Return the maximum fetch | |
javax.jdo.identity.IntIdentity; javax.jdo.identity.IntIdentity This class is for identity with a single int field. Since: JDO 1.0 Public ... pcClass, int key) Constructor with class and key. Parameters: pcClass - the class key - the key Since: JDO 1.0 Public Methods int compareTo (Object o) Determine the ordering | |
javax.jdo.FetchGroup of this FetchGroup. Return: the post-load property Since: JDO 2.2 int getRecursionDepth (String  ... Since: JDO 2.2 int hashCode () Return the hashCode for this instance. The hash code should combine ... ;memberName, int recursionDepth) Set the recursion-depth for this member. The default is 1 | |
javax.jdo.listener.InstanceLifecycleEvent NotSerializableException. Since: JDO 2.0 Public Constructors InstanceLifecycleEvent (Object source, int ... (Object source, int type, Object target) Creates a new event object ... " Since: JDO 2.0 int getEventType () Returns the event type that triggered this event. Return | |
StateManager.getIntField(pc,field,currentValue) - JDO Method JDO Method in javax.jdo.spi.StateManager int getIntField ( PersistenceCapable pc, int field, int currentValue ) Return the value for the field. Parameters: pc - the calling PersistenceCapable instance field - the field number | |
StateManager.setIntField(pc,field,currentValue,newValue) - JDO Method JDO Method in javax.jdo.spi.StateManager void setIntField ( PersistenceCapable pc, int field, int currentValue, int newValue ) Mark the field as modified by the user. Parameters: pc - the calling |