About getResultList

forum_thread

IN operator syntax

Hi, what is the correct syntax for IN operator when list of literals ia used instead of parameter, e.g. SELECT FROM Info i WHERE i.status IN (1,4) ? (Suppose status is int.) I always get this exception: SELECT FROM Info i WHERE i.status IN (1 ==> , <== 4) javax.persistence.PersistenceException Unexpected query token ',' (closing ')' is missing) (error 752)   Query with only one item in list works fine: ... ) ; List resultList = query. getResultList ( ) ; System. out . println ...

 
forum_thread

Error during cascaded merge

Hello! I have a new problem with ObjectDB 2.5.5_02. This issue appeared after the upgrade from 2.5.5. I get the following exception: ... ) ; List<Unit> result = query. getResultList ( ) ; Unit unit = result. get ...

 
forum_thread

Performance in SELECT statement

Hello, I have the following 2 entities : ... ;   List<TestEntity> results = query. getResultList ( ) ; I would be very happy if ...

 
forum_thread

Is there any faster select method?

SELECT: TypedQuery<Point> query = em.createQuery("SELECT p FROM Point p WHERE p.id = " + element.getId(), Point.class); List<Point> points = query.getResultList();   WRITE: em.persist(p);   ** the Point class is of the tutorial.   I found the above select method is ten times slower than the write method, in my very simple benchmark. I guess the reason there is no SQL in the write method.   ... ) ; List<Point> points = query. getResultList ( ) ; WRITE: em. persist ...

 
forum_thread

Unexpected behaviour upon update. Bug?

This sample does not work as I expect.  Why?  Is it a bug? Below is the complete program. Expect: 3 Get: 4 import java.io.Serializable; import java.util.List; import javax.persistence.*; @Entity public class Update implements Serializable   {     @Id     int i;     int v; ... Update s" , Update. class ) . getResultList ( ) . listIterator ( ) . next ...

 
forum_thread

EntityManager.refresh takes a long time

EntityManager.refresh takes a long time for entity object Person in this code: ... ; List<Person> persons = personQuery. getResultList ( ) ;   logger. log ( Level. ...

 
forum_thread

Possible issue for JPQL IS EMPTY expression

Possible issue for JPQL IS EMPTY comparison expression: SELECT e FROM MyEntity e WHERE e.collection-valued IS EMPTY throws javax.persistence.PersistenceException: Invalid operand type  for operator IS EMPTY (error 756) Thanks. ... ; System. out . println ( query. getResultList ( ) . size ( ) ) ; ...

 
forum_thread

Problem of query With an aggregate function

Hi I would know if this type of query is supported By JPA: select sum(nb1), sum(nb2), sum(nb3) from table If yes I have this methode that return a list of Long: ... [ ] > ) listClassRepHost. getResultList ( ) ;     List<Long> ...

 
forum_thread

JPA vs JDO - which is more efficient for OneToMany queries?

I'm curious about the trade offs between JDO and JPA. Seems to me that JDO will perform better and be statically typed. For example: Assume there are Customers and Orders.... o FROM Order o WHERE o.customer=" + c ) . getResultList ( ) ; QUESTION: Apart from the loss ...

 
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. ... ) ; List<Mark> results = query. getResultList ( ) ; if ( results. size ...