About TypedQuery

forum_thread

Error using query with MAX() function

I have a class that is persisting a Entity that holds remarks and a time. Then when I query for the latest remark I get a internal error when the remark is larger than 1966 chars. Here is a test class and entity that reproduces the problem on my system. ... q. where ( predicate ) ;   TypedQuery<Object> tq = em. createQuery ( s ) ; ...

 
forum_thread

Error 363 - Failed to read value of inverse relationship

I've got two objects: @Entity public class EEvent { @Id @GeneratedValue(strategy = GenerationType.AUTO) private long id; @ManyToOne(optional=false) private ETown town; public ETown getTown() { return town; } public void setTown(ETown town) { this.town = town; } } And: ... null ; try { TypedQuery<Player> query = getEntityManager ( ) . ... null ; try { TypedQuery<Player> query = db. createQuery ( "SELECT p ...

 
forum_thread

Updating Entities

Hello, I'm currently writing a program using JavaFX and ObjectDB and I'm encountering a problem with Entities not sending their updates to each other. I have two Entities in question at the moment: Employee and Paygrade. ... " \t newRate: " + newRate ) ;   TypedQuery<Paygrade> query = Main. paygradeDB . createQuery ... ORDER BY rate" , Paygrade. class ) ; TypedQuery<Paygrade> modifyTo = Main. paygradeDB . createQuery ...

 
issue

Schema-Update: Rename superclass and remove one subclass

Hello, we renamed a superclass and removed one of the subclass. If we then try to open the Database (with ObjectDB-Explorer) we get a "Failed to generate dynamic type ..."   Small Example: Generate Database ... try to ecexute a Query (in the second main method): TypedQuery<RenamedSuperClass> q = em. createQuery ( ...

 
tutorial

Step 3: Add a Main Class

Explains how to add the JPA tutorial Main class in Eclipse.... all the Point objects from the database: TypedQuery<Point> query = em. createQuery ( ...

 
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

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

Schema-Update: Rename superclass and remove one subclass

Hello, we renamed a superclass and removed one of the subclass. If we then try to open the Database (with ObjectDB-Explorer) we get a "Failed to generate dynamic type ..."   Small Example: Generate Database ... try to ecexute a Query (in the second main method): TypedQuery<RenamedSuperClass> q = em. createQuery ( ...

 
forum_thread

Failed to write the value of field using reflection (error 363) on LAZY fetch

Hi There I am using ObjectDB 2.6.3. I get the following Exception when I try to read my entities with a query where I have set to use LAZY initalization. It fails when it tries to set a 1:n member (e.g. a Modell has several Artikels) . When I remove the LAZY hint on the query execution it works. Any hints why this can happen? The Mapping of class Modell and its member: ... ( Class<T> classEntity ) { TypedQuery<T> query = getEntityManager ( ) . ...

 
forum_thread

Query in JPA2 with LEFT JOIN on INNER JOIN

select a.description, a.id, p1.description, p2.description,p3.description from action a left join action_profile ap1 on ap1.id_action=a.id inner join profile p1 on  ap1.id_profile=p1.id  and p1.name='?' left join action_profile ap2 on ap2.id_action=a.id inner join profile p2 on  ap2.id_profile=p2.id  and p2.name='?' where a.id =?;   Thanks   ... masterPredicate ) ;   TypedQuery<ActionProfileAdminAdvancedResponse_> query = ...