About getResultList


Update query bug

Some code. Problem in UPDATE query.   ... List < Transport >> list = query . getResultList ( ) ; List < Transport > temp = ...


Selecting random rows

Hello is there way to get random rows? Functions line rand(), random(), newid() doesn't work ;/ for example: em.createQuery("SELECT s FROM StawkaVat s ORDER BY rand()").setMaxResults(5).getResultList(); gives exception: ... ) . setMaxResults ( 5 ) . getResultList ( ) ; gives exception: ... (error 752) (position 26) at com.objectdb.jpa.JpaQuery.getResultList(JpaQuery.java:725) ...


Query perfromance problem

Hi, I was playing with paging and sorting recently and after trying few different aproaches got some strange behavior from ODB. First of all, I will show you results from page rendering times, but trust me - when debugging application, getting data from ODB takes a long time in one case. Anyway, one of my methods in DAO looks like this: ... start ) . setMaxResults ( count ) . getResultList ( ) ; logger. debug ( "Query ...


How to query for list of lists ?

Hi, I have a problem with constructing query, that gets only embedded list of integers from Entity. Here's the example : Query query = em.createQuery("SELECT i.filterDescription FROM Inspiration i"); List<List<Integer>> result = query.getResultList(); where Inspiration is like this : ... ; List<List<Integer>> result = query. getResultList ( ) ; where Inspiration is like this ...


Handling "is null" in where clause

Greetings, I was playing aroung with JPQL and have found that there is a problem with "is null" queries. When you use "is null" in where clause, query runs correctly, but results are incorrect. Let me show you an example: - entity @Entity public class EntityA { @Id Integer id; Integer simpleField; (getters and setters here) - populating database... ; List<EntityA> resultList = query. getResultList ( ) ; System. out . println ( ...


Step 3: Define an EJB Session Bean

Explains how to define an EJB session bean in a NetBeans Java EE web application.... , Guest. class ) ; return query. getResultList ( ) ; } } ...



Specifies a static, named query in the Java Persistence query language.(Annotation of JPA)


Extra uninitialised entities spawned on merge()

In the following, Element is a base entity class, with a bi-directional @ManyToOne-@OneToMany relationship Element owner - List<Element> ownedElements, and Example is a subclass entity with a relationship @OneToOne Element child. ... ; List<Element> results = query. getResultList ( ) ; for ( Element ...


Retrieve data of all entity classes in a single query

I have in an objectdb file 10 Entity Classes with some data in each (Athlete, Trainer, Stadium etc) This is the code I use to retrieve all Managed Types and data for the Athlete class ... avoid this List<Athlete> results = query. getResultList ( ) ; for ( Athlete result : ...


CriteriaQuery using isNotNull with other conditions results in InternalException

When I try to execute the following criteria query   ... = em. createQuery ( criteria ) . getResultList ( ) ; i get the exception ... com.objectdb.jpa.JpaQuery.getResultList(JpaQuery.java:586) at ...