About TypedQuery

forum_thread

Problem with Criteria Querys

Hi, i am having problems running following code...   ... ) ,p2 ) ) ) ; TypedQuery<DataObject> query = em. createQuery ( q ) ...

 
forum_thread

Performance in SELECT statement

Hello, I have the following 2 entities : ... WHERE e.state.entityState IN :state" ;   TypedQuery<TestEntity> query = em. createQuery ( strSelect, ...

 
api-jpa

close()

Close an application-managed entity manager.(Method of javax.persistence.EntityManager)

 
forum_thread

Empty query results after JAR creation

Hi, I struggle with a strange issue. I've embedded ObjectDB in a small application to query cases. Within Netbeans everything works fine but when I create a  JAR File and executed via "Java -Jar xyz.jar", I get either empty results or on some cases a "NoResultException" which appears to report the same issue. I've created a small test case (attached zip file) with sample DB to reproduce the issue.  ... String s = "SELECT c FROM Case c" ;   TypedQuery<Case> q = em. createQuery ( s, Case. class ...

 
issue

query.getResultList() throws ClassCastException

I modified the example code to include an index on the Point class like so:     @Index(members={"x","y"}) Then when I run the following query:     TypedQuery<Point> query = em.createQuery("SELECT p FROM Point p where p.x <= :x and p.y >= :y",         Point.class); I get the exception at the end.  I do not get an exception if I: ... when I run the following query:     TypedQuery<Point> query = em.createQuery("SELECT p FROM Point p where p.x ...

 
forum_thread

How to do multithreading with embedded ObjectDB

Hi, I've tried to implement a counter with ObjectDB, but the following code doesn't work as expected: ... emf. createEntityManager ( ) ; TypedQuery<Point> myquery = em. createQuery ( "SELECT p ...

 
forum_thread

Problem with queries on lists with reverse mapping

Hi, In version 2.4.2, when an object in a list is reversed mapped to the owning object, queries are returning objects of types that were not specified in the query.   In the attached example the last test fails because the query returns both TeamA and TeamB objects where only TeamA was specified in query. If the "team" is omitted from the player and targetEntity = Player.class, mappedBy = "team" are removed from Team the query returns the expected result.   ... from Team the query returns the expected result. TypedQuery<TeamA> query7 = em. createQuery ( "SELECT t ...

 
forum_thread

possible index required for improving query performance

Hi,   I have the following entity class:   @Entity @Table @Indices({ @Index(members={"relationshipType", "party"}), @Index(members={"relationshipType", "otherParty"}),     @Index(members={"relationshipType"}) }) @XmlRootElement public class Relationship implements Comparable<Relationship> { ... } With the following query: TypedQuery<BaseObject> query = em ( ) . createQuery ...

 
issue

InternalException when using MEMBER OF on a large list in a query

Hello, we get when executing a query with MEMBER OF on a large list the following InternalException: Caused by: com.objectdb.o.InternalException: merge2 com.btc.ep.coverage.bl.internal.dmos.CoverageRecordImpl:null => merger[2850057]-missing:223 at com.objectdb.o.PBI.B(PBI.java:124) at com.objectdb.o.PBI.q(PBI.jave:97) at com.objectdb.o.OBI.Vp(OBI.java:244) (... more see attached Image) Our query looks like this: ... AND property.scopeID MEMBER OF ?1" ; TypedQuery<String> q = em. createQuery ( query, String. ...

 
forum_thread

Is it possible get the All PrimKeys for a given entity class in the DB?

Hi, I would like to retrieve all the primKeys (user defined) by doing something like: TypedQuery<MyClassPrimKey> query = em.createQuery("SELECT mif.primkey FROM MyClass mif", MyClassPrimKey.class); The only alternative I can think of - would be to store the primkey on the object - but sounds like it is double storage Thanks ... (user defined) by doing something like: TypedQuery<MyClassPrimKey> query = em. createQuery ( ...