ObjectDB ObjectDB

Internal Website Search

11-20 of 200 resultsRefresh
19

Running JPA Queries

object, which is a Long object reflecting the number of Country objects in the database: TypedQuery<Long> query = em.createQuery( "SELECT COUNT(c) FROM Country c", Long.class); long ... Country c"); long countryCount = (Long)query.getSingleResult(); An aggregate COUNT query
17

Auto Generated Values

(strategy=GenerationType.AUTO) long id; : } AUTO is the default strategy, so the following definition is equivalent: @Entity public class EntityWithAutoId2 { @Id @GeneratedValue long ... @GeneratedValue(strategy=GenerationType.IDENTITY) long id; : } The IDENTITY strategy
16

Shared (L2) Entity Cache

and primary key: em.find(MyEntity2.class, Long.valueOf(1),      Collections.<String,Object ... , Long.valueOf(1),    Collections.<String,Object>singletonMap(         "javax.persistence ... is cached: boolean isCached = cache.contains(MyEntity.class, Long.valueOf(id)); Cached entity
16

ObjectDB Object Database Features

(for persistent fields) Primitive types (boolean, byte, short, char, int, long, float, double). Wrapper types (Boolean, Byte, Short, Character, Integer, Long, Float, Double). java.lang.String Date types: java ... , char, int, long, float and double). Wrappers (Boolean, Byte, Short, Character, Integer, Long
13

JPA Persistable Types

: boolean, byte, short, char, int, long, float and double. Equivalent wrapper classes from package java.lang: Boolean, Byte, Short, Character, Integer, Long, Float and Double. java.math.BigInteger ... ) collection and map types are supported, as long as their values (i.e. elements in collections and arrays
13

Numbers in JPQL and Criteria Queries

Java (e.g. for int and long operands the MOD function returns a long value). The SQRT Function ... , but all the numeric types (byte, short, int, long, float, double, BigInteger, BigDecimal) are supported. Unary
13

GROUP BY and HAVING clauses

functions of SQL: COUNT - returns a long value representing the number of elements. SUM - returns the sum ... in that letter's group as a Long object and the third cell contains the distinct number ... interface provides methods for building aggregate expressions: count, countDistinct - return a long type
2

Step 2: Define a JPA Entity Class

implements Serializable { private 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
2

Step 2: Define a JPA Entity Class

{ private static final long serialVersionUID = 1L; @Id @GeneratedValue private long ... y) { this.x = x; this.y = y; } public Long getId() { return
2

Step 2: Entity Class and Persistence Unit

.persistence.Id; @Entity public class Guest implements Serializable { private static final long serialVersionUID = 1L; // Persistent Fields: @Id @GeneratedValue Long id

Getting Started

ObjectDB is very easy to use. Follow the Getting Started Tutorial and the Quick Tour manual chapter and in minutes you may be able to write and run first Java programs against ObjectDB.

Prior knowledge or experience in database programming (SQL, JDBC, ORM, JPA, etc.) is not required, but some background in using the Java language is essential.

Need Help?

  1. Search ObjectDB website
  2. Read the FAQ
  3. Follow the Tutorials
  4. View or post in the forum
  5. Search or file an issue
  6. Contact support