About getResultList

issue

Strange Error with Criteria API and Sorting

We're creating a simple selection (distinct) including an order clause. When watching the created criteria in debugger we get the correct expression: SELECT DISTINCT $1 FROM MyEntity $1 WHERE ((TYPE($1)=class test.MyEntity)) ORDER BY UPPER($1.name) DESC You can see that in the order by there's correctly a "$1" var. Running this (without the type thing before) in the explorer correctly returns the sorted results. However, running this with the criteria API produces this error: ... result = em. createQuery ( query ) . getResultList ( ) ;   for ( TestEntity e ... (error 745) (position 70) at com.objectdb.jpa.JpaQuery.getResultList(JpaQuery.java:695) at ... com.objectdb.jpa.JpaQuery.getResultList(JpaQuery.java:686) ... 1 more Looks like the issues occurs ...

 
forum_thread

java.sql.Date equals comparison not working with CriteriaAPI

Hello, Using ODB 2.4.5 and the Criteria API, doing a simple equals comparison with java.sql.Date value doesn't match any results in the database. Our code looks like this: ... List<MyDateEntity> resultList = query. getResultList ( ) ;   System. out . println ...

 
issue

JPA Composite Key make Object Db throws "Unexpected exception (Error 990)"

Hello Object Db community :) I am using this wonderful library and I caught a strange exception while testing the "composite key" feature in JPA. Let's see what I am doing : @Entity public class Book {     @EmbeddedId BookId id; } @Embeddable Class BookId {     Integer bookIdCountry;     ECountry country; } My BookId contains 2 attributes: One Integer and one enum. ... e" ) ; List resultList = query. getResultList ( ) ; System. out . println ...

 
forum_thread

Help with 'not like/lower' query

Hi again,   Honestly, I'm fairly new with JPA2 Criteria queries - but as far as code effort goes, it has saved me a bit of pain. I'm writing a dynamic query builder (only 1 level deep for basic entities) - but  even though I get most queries to work, I am getting the following error. This is using Criteria with a combination of LOWER/UPPER - NOT LIKE: ... List<MyEntity> resultList = query. getResultList ( ) ; System. out . println ...

 
forum_thread

Optimistic locking: prevent version increment on entity collection attribute

Hello, I have an entity E with an attribute which is a collection of entities (one to many relationship) with an optimistic locking strategy supported by a version field. Is it possible to prevent the increment of the version of entity E when entities are added to or removed from the collection? Something like the equivalent of @OptimisticLock(excluded=true) in Hibernate? Thanks, Farid ... e from Document e", Document.class).getResultList() and then loop through the result. Hope you can ...

 
page

Posting to ObjectDB Website - Important Instructions

Instructions for posting to ObjectDB website (to the forum, the issue tracking and the help desk).... e" ) ; List resultList = query. getResultList ( ) ; System. out . println ...

 
forum_thread

OutOfMemoryError on search after update on DB created with DB Doctor

It looks like there may be an issue with the DB files created with DB Doctor in recovery mode. This is the scenario that results in the OutOfMemory exception problem (using Object DB 2.5.4_04): 1. We instruct Object DB to create a 1Gb DB file on initial start-up using: <database> <size initial="1024mb" resize="256mb" page="2kb" /> This happens as expected. ... at com. objectdb . jpa . JpaQuery . getResultList ( JpaQuery. java : 716 ) ...

 
forum_thread

ORDER BY problem, when String starts with language specific character

Dear all, I have a problem with ORDER BY clause. I have a simple query: select u from User u order by u.name When the name starts with "normal/english" character, records are ordered correctly. But when it starts with language specific character like 'Č', these records are placed after records with normal charaters. So records with 'Č' are after 'Z', but this is not correct, because 'Č' is between 'C' and 'D'. ... ) ; List resultList = query. getResultList ( ) ; System. out . println ...

 
forum_thread

@ElementCollection of type enum

Hi! I have in an entity called User with the following field: @ElementCollection(fetch = FetchType.EAGER) private Set<UserPermission> permissions; package x.x.x.x public enum UserPermission { BASIC, COACH, ADMIN } Use case: there are users which contain the first 2 permissions (BASIC and COACH, so the first 2 entries). ... ; List<MyEntity> resultList = query. getResultList ( ) ; for ( MyEntity e : ...

 
forum_thread

Problems down-casting in WHERE clause

I have a family of related types, like this: @Entity class Base { String val1; String val2; }; @Entity class Derived1 extends Base { String val3; }; @Entity class Derived2 extends Base { String val4; };  I'm trying to implement a query which will return all Base objects which have a given string within any of their String-typed fields.  The query I'm using looks somewhat like this: ... ( "search" , "" ) ; query. getResultList ( ) ; em. close ( ) ...