About expression

forum_thread

Group by date / time

Hi, I'm trying to create reporting query that will return entities grouped by year / mont / day. Each entity has it's own field that holds java.lang.Date. There is no function like YEAR(), MONTH() or DAY() in ODB. So, how to build queries similar to something like this: SELECT COUNT(id) FROM stats WHERE YEAR(record_date) = 2009 GROUP BY YEAR(record_date), MONTH(record_date) or maybe something like this: #1 2011-07-10 14:01 Hi, I'm trying to create reporting query that will return entities grouped by year / mont / day. Each ...

 
forum_thread

Navigation and Parameters

Greetings ObjectDB team, Suppose I pass a List of persistent objects to some query as a parameter, can I navigate to those objects' fields ? E.g.: SELECT x FROM ClassX x WHERE x.a IS MEMBER OF :y.b... in JDO. So if the parameter y is a collection the expression y.b is invalid. ObjectDB Support ...

 
api-jpa

key()

Create a path expression that corresponds to the map key.(Method of javax.persistence.criteria.MapJoin)

 
api-jpa

getModel()

Return the bindable object that corresponds to the path expression.(Method of javax.persistence.criteria.Path)

 
api-jpa

value()

Create a path expression that corresponds to the map value.(Method of javax.persistence.criteria.MapJoin)

 
forum_thread

Inconsistent return types from JDO query

I'm running a JDO query which returns the sum of an int field.  The return type of the Object produced by the Query is inconsistent - sometimes Integer, sometimes Long.  Using setResultClass(Long.class) has no effect. ... The type of a sum expression depends on the type of the field on which it works, but should be ...

 
api-jdo

setOrdering(ordering)

Set the ordering specification for the result Collection.(Method of javax.jdo.Query)

 
forum_thread

Multi selection and distinct in a criteria query

hi, How can I realize multi selection with the criteria api concerning distinct? I.e. doing something like SELECT DISTINCT $1, $2 wouldn't work because I do only have something like criteria.multiselect(...) and nothing like builder.distinct(selection) so that I could do something like criteria.multiselect(builder.distinct($1), $2)... ?? Alex ... selection only? I.e. I don't want to every selection expression being distinct (i.e. when selecting names which may double without ...

 
api-jpa

javax.persistence.PersistenceUnit

Expresses a dependency on an EntityManagerFactory and its associated persistence unit.(Annotation of JPA)

 
api-jdo

addSubquery(sub, variableDeclaration, candidateCollectionExpression)

Add a subquery to this query.(Method of javax.jdo.Query)