About TypedQuery

forum_thread

Subquery error

My query: TypedQuery<Station> query = em.createQuery("SELECT p FROM Station p WHERE rid = (SELECT p FROM Station p where tpl='York') AND tpl != 'York'", Station.class);   Error: ... My query: TypedQuery<Station> query = em. createQuery ( "SELECT p ...

 
forum_thread

Sorting problem

Hi, I was rewriting our DAO to support pagging in large dataset and I think I have found a problem with sorting. I send you a test case - sorry for using the same project as previous, but it was faster to write this test case. As usual, you can load data with DataLoader and then check problem with QueryData. There is a simple query with "order by" sentence: ... List<Branch> prodList = null ; TypedQuery<Branch> icQuery = null ; String q = null ...

 
forum_thread

Problem with Criteria Querys

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

 
issue

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

 
forum_thread

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

 
forum_thread

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

 
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

How to creat a Query with Sql which returns a List<Mark> marks

How can i get out of the db my Athlete Objekt his list<Mark> marks collection with a createQuery Sql-Statement. the Mark and Athlete Object do not really have a primary or secondary key together, the list mark is just stored in the athletes object, not as an embeddable but as an entity. ... = new DBConnection ( ) ; TypedQuery<Mark> query = dbConnection. getEm ( ) . ...

 
forum_thread

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

 
forum_thread

Error: Failed to write value of field X using reflection (oneToMany relation)

Hi there! I have been all day trying to solve this. I have read multiple sites and documentation, but I can go through this. I have a clase named Pedido, that have a reference ManyToOne to a clase Cliente. ... results = null ; try { TypedQuery<Cliente> query = em. createQuery ( "SELECT c ...