ObjectDB ObjectDB

Internal Website Search

21-30 of 86 resultsRefresh
125

CriteriaQuery .where() for multiple conditions

When using the below, there appears to be an OR condition: criteriaQuery.where(criteriaBuilder.equal(root.get("name"), name)); criteriaQuery.where(criteriaBuilder.equal(root.get("surname ... (); CriteriaQuery criteriaQuery = criteriaBuilder.createQuery(Person.class); Root
120

"Unexpected query expression" using CriteriaQuery FetchParent Interface

em = emf.createEntityManager();   CriteriaBuilder cb = em.getCriteriaBuilder();   CriteriaQuery<Person> criteriaQuery = cb.createQuery(Person.class);   Root<Person> root = criteriaQuery.from(Person.class);   root.fetch("PersonData"); //@OneToOne relationship   criteriaQuery.select(root
116

JPA CriteriaQuery -- Iterate Expression<List<Object>>

Hi, I am new to JPA and in particular the CriteriaQuery API. I have a simple CriteriaQuery where I pattern match a simple search String against field entires in a Person entity... i.e ... "); criteriaQuery.where( builder.or( builder.like( root.<String>get("name
110

CriteriaQuery using isNotNull with other conditions results in InternalException

When I try to execute the following criteria query CriteriaBuilder builder = em.getCriteriaBuilder(); CriteriaQuery criteria = builder.createQuery(relationshipClass); Root root = criteria.from(relationshipClass); criteria.select(root); List
45

SELECT clause (JPQL / Criteria API)

DISTINCT c.currency FROM Country c can be built as a criteria query as follows: CriteriaQuery ... : CriteriaQuery<Object[]> q = cb.createQuery(Object[].class); Root<Country> c = q.from(Country.class); q ... as a clean alternative to Object[]: CriteriaQuery<Tuple> q = cb.createTupleQuery(); Root
36

FROM clause (JPQL / Criteria API)

interfaces). Criteria Query Roots The CriteriaQuery's from method serves as a factory of Root instances ... : CriteriaQuery<Country> q = cb.createQuery(Country.class); Root<Country> c1 = q.from(Country ... other CriteriaQuery methods - invocation of the from method does not override a previous invocation of that method
27

WHERE clause (JPQL / Criteria API)

but they are especially dominant in the WHERE clause. WHERE in Criteria Queries The CriteriaQuery interface ... .population > :p can be built by using the criteria query API as follows: CriteriaQuery<Country> q = cb ... .area < :a can be built as a criteria query as follows: CriteriaQuery q = cb.createQuery(Country
22

GROUP BY and HAVING clauses

become inaccessible. GROUP BY and HAVING in Criteria Queries The CriteriaQuery interface provides ... .currency HAVING COUNT(c) > 1 can be built using the criteria query API as follows: CriteriaQuery
22

ORDER BY clause (JPQL / Criteria API)

the result order would be undefined. ORDER BY in Criteria Queries The CriteriaQuery interface provides ... : CriteriaQuery<Country> q = cb.createQuery(Country.class); Root<Country> c = q.from(Country
14

javax.persistence.criteria.CriteriaBuilder

Since: JPA 2.0 CriteriaQuery<Object> createQuery() Create a CriteriaQuery object. Create a CriteriaQuery object. Returns: criteria query object Since: JPA 2.0 CriteriaQuery<T> createQuery(Class<T> resultClass) Create a CriteriaQuery object with the specified result type. Create a CriteriaQuery object

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