About WHERE

forum_thread

java.sql.Timestamp.getTime() not working

Hi, I need to work with Timestamp diff in two entity fields, but this queries SELECT count(p) FROM Player p WHERE p.loginAt.getTime()-p.registeredAt.getTime()>:value SELECT p.loginAt.getTime() FROM Player p fails with object is not an instance of declaring class but SELECT p.loginAt.getYear() FROM Player p works. How that possible?   ... SELECT count ( p ) FROM Player p WHERE p . loginAt . getTime ( ) - p . registeredAt . ... . getTime ( ) FROM Player p WHERE p . registeredAt! = NULL ...

 
issue

ArrayIndexOutOfBoundException

Hello, we got this exception when using ObjectDB: ... to locate  a page with a negative ID in the cache, where page IDs are never expected to be negative. Please provide the ... test till now, it occurs during our stress systems tests, where many threads are running concurently and usually after some hours of ...

 
issue

new objects not available in mappedBy associations

Given a mappedBy association: e.g: @OneToMany(mappedBy="department") public List <Employee> employees;   creating a new mapped class, e.g. new Employee, won't result in this object being available in the same transaction: ie: for (Employee e : department.employee) won't include the new object, even if it is persisted, and even if the transaction is committed??  ... If the mappedby tag maps to: SELECT e from EMPLOYEE e WHERE e.department=department then shouldn't it automatically return a ... mappedby tag maps to: > SELECT e from EMPLOYEE e WHERE e.department=department > then shouldn't it automatically return a ...

 
manual

Paths and Types in JPQL and Criteria API

Explains how to use object expressions (path navigation, type) in JPA/JPQL.... objects and values. For example - c.capital , where c represents a Country entity object uses the capital persistent ... SELECT COUNT ( e ) FROM Object e WHERE TYPE ( e ) <> Country Binding an ...

 
forum_thread

Eager Fetch is not stable for collection or map types?

Hi, thanks very much for your helpful software. The problem is the storage of collection or map types is not stable, we lost them sometimes after JVM restarted. Eager fetch is properly set.And we still found that the storage is stable when we not use generic, such as "private List users = new ArrayList();" instead of "private List<User> users = new ArrayList<User>();".   The code about entity and fetch is: ... = em. createQuery ( "select k from Game k where k.id=:id" , Game. class ) ; List<Game> result = ... = em. createQuery ( "select k from Game k where k.id=:id" , Game. class ) ; List<Game> result = ...

 
issue

Weird issue with variable naming

hi, ... $1. We're also adding a custom function expression in where clause though however as said, cannot replicate it in a demo, however ... ( "name" ) ) ;   cq. where ( cb. equal ( join2. get ( "name" ) , ...

 
forum_thread

Composite indexes

Hi, I read your manual about defining Indexes for JPA Entities (http://www.objectdb.com/java/jpa/entity/index), but I still have some problems understanding how and when should I use them.   Let's start with some example then. Assume we have an entity that represents an interior design image, called Inspiration : ... index should be a field that is most commonly used in WHERE clauses or maybe the filed that is used in ORDER clause for query that ... to this : SELECT i FROM Inspiration i WHERE i . room = "bedroom" AND 4 MEMBER OF i . ...

 
api-jpa

javax.persistence.criteria.From

Represents a bound type, usually an entity that appears in the from clause, but may also be an embeddable belonging to an entity in the from clause.(Interface of JPA)

 
issue

Issue with TYPE expression in Criteria API

Find attached project using latest 2.3.4_03 odb still causes:   ... SELECT $1 FROM com.test.virtual.model.MyCustomer $1 WHERE TYPE($1)=class com.test.model.Customer Exception in thread "main" ... cq. select ( e ) ; cq. where ( cb. equal ( e. type ( ) , cb. literal ...

 
api-jpa

javax.persistence.criteria.PluralJoin

The PluralJoin interface defines functionality that is common to joins to all collection types.(Interface of JPA)