About TypedQuery


Problem with Criteria Querys

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


Super class' field access fails

I have a base class: public abstract class HotObject extends BaseObject {   private Integer activity;   protected HotObject() {     activity = 1;   }   public Integer getActivity() {     return activity;   }   public void setActivity(Integer activity) {     this.activity = activity;   } ... Now, when issuing the following query: TypedQuery<HotTag> query = em.createQuery("SELECT t FROM HotTag t ORDER ...


Performance in SELECT statement

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



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


EntityManager.refresh takes a long time

EntityManager.refresh takes a long time for entity object Person in this code: ... . toString ( ) ) ;   TypedQuery<Person> personQuery = em. createQuery ( ...


Navigation through Path to evaluate collection

Hello, I need to evaluate a field ("identifier") which is situated in a collection, within an entity. As stated in the documentation it is not possible to navigate there with the dot operator since its a collection. Is it there a way to evaluate this field? Here is the query, the entity and the related embeddable class. Thanks ... ( String key ) {   TypedQuery<ProductData> myquery = em. createQuery ( ...


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 ...


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 ...


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 ...


Accessing objects to make them available after EntityManager close?!

Hi, I would like to get all the instances of an entity object. So I wrote a function which returns a list of these instances. My problem is if I print out these instances before closing the em and returning the list, it works as I expected; if not, the function returns only one field correctly, another field is always Null. The details is as follows: ... createEntityManager ( ) ;   TypedQuery<Vifr_dic> query = em. createQuery ( "SELECT ...