About named queries

forum_thread

Optimization of Map Queries

hi! I am having loads and loads of occurrences of something like ((com.test.MyEntity) $1.map.get('com.test.MyEntity')).someProperty ... ((com.test.MyEntity) $1.map.get('com.test.MyEntity')).someOtherProperty .. ((com.test.MyEntity) $1.map.get('com.test.MyEntity')).someMoreProperties I need to use full qualified names for casting as well as for the map keys because same entity simple names may occur multiple times. Now I've got two questions: ... implementation of the  Map 's get method in queries is not very efficient, and in addition the result is not reused but ... extension, so it might not be available in criteria queries. Maps are indeed commonly used by ObjectDB users, but mainly ...

 
api-jpa

setParameter(name, value, temporalType)

Bind an instance of java.util.Date to a named parameter.(Method of javax.persistence.Query)

 
forum_thread

Object as parameter results in exception

Hi,    I've got a simple JPA2 Criteria query which fails when doing an object equality. I verified this against EclipseLink and over there, it works. I'll Attach some code snippets to help figure it out:   @Entity() public class Product{ . . . @ManyToOne     private Compamy owningCompany; } @Entity() public class Company{    .    .    .     @Id    private Long id; } and the query: ... cache cannot be used. Maybe ObjectDB should optimize such queries replacing literals with parameters automatically, whenever possible. ... are a pretty bad idea! Most of our queries will still be named queries, just our 'search' queries will be coded as Criteria ...

 
api-jpa

setParameter(name, value, temporalType)

Bind an instance of java.util.Calendar to a named parameter.(Method of javax.persistence.Query)

 
forum_thread

JPQL query to get entities that does not have a child entity in their child entities

I have 2 tables as shown below. Job Table ID JobId Name StartTime    FinishTime    .... 01 001   A  2105:12:10 14:00:00  2105:12:10 14:00:10 02    002  A  2105:12:10 14:00:00  2105:12:10 14:00:00 03    003  A  2105:12:10 14:00:00  2105:12:10 14:00:00 04    004  A  2105:12:10 14:00:00  2105:12:10 14:00:00 And ... using TomEE for deployment. I am using following queries. < strong > FINISHED </ strong > Jobs ... <> 'Finished' " ), With these queries I am getting wrong result for ACTIVE Jobs. A job even with failed or ...

 
issue

Error 990 when querying a class with persistence-capable-superclass

[ObjectDB 2.4.7_07] Unexpected exception (Error 990) Generated by Java HotSpot(TM) Server VM 1.7.0_10 (on Linux 3.2.0-39-generic-pae). Please report this error on http://www.objectdb.com/database/issue/new com.objectdb.o.InternalException: null com.objectdb.o.InternalException at com.objectdb.o.InternalException.f(InternalException.java:236) at com.objectdb.o.STA.K(STA.java:339) at com.objectdb.o.ENT.D(ENT.java:533) at com.objectdb.o.ENT.M(ENT.java:681) at com.objectdb.o.LDR.F(LDR.java:589) at com.objectdb.o.LDR.E(LDR.java:466) ... query. execute ( ) ; All queries (eg ones with parameters) on the same class fail with the same error. ...

 
forum_thread

slow performance for a complex query

Hi, We have a query that is constructed dynamically, an example is like this: SELECT DISTINCT $1 FROM CDI $1, Organisation $2, Organisation $3 WHERE ((UPPER($1.cdiId) LIKE 'THREAD14%') AND ((($1.parentOrgId='news') OR (($1.parentOrgId=$2.organisationId) AND ($2.parentOrgId='news'))) OR ((($1.parentOrgId=$3.organisationId) AND ($3.parentOrgId=$2.organisationId)) AND ($2.parentOrgId='news')))) I've also tried running the CDI query first and passing the results into the organisation query as follows: ... cannot help). There are different types of nested queries. Some nested queries are actually equivalent to JOIN. When the inner query is not dependent ...

 
forum_thread

Query by array element

Hello, I have a class as follows: @Entity public class MyEntity {     boolean properties[]= new boolean[1024]; } I would like to query objects with feature '42': select me from MyEntity me where me.properties[42]=true Is it possible? Thank you! ... query is not supported since you cannot access arrays in queries. You can implement a method in MyEntity that wraps the ...

 
api-jpa

javax.persistence.criteria.PluralJoin

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

 
api-jpa

javax.persistence.criteria.Root

A root type in the from clause.(Interface of JPA)