About SELECT

forum_thread

Issue with alias

Hi, This query works and correctly casts and selects my entity into the tuplet: SELECT $1, ((com.lexware.vereinsverwaltung.abrechnung.api.model.mitglied.MitgliedDebitorenKontoFragment)$1.qubletFRAGMENTMAP.get('com.lexware.vereinsverwaltung.abrechnung.api.model.mitglied.MitgliedDebitorenKontoFragment')) AS DEB FROM com.lexware.vereinsverwaltung.verein.mitglied.Mitglied $1 WHERE DEB.debitor=true however, trying to access "DEB" in the where clause causes an "unexpected token" error? Alex ... casts and selects my entity into the tuplet: SELECT $1 , ( ( com . lexware . vereinsverwaltung . ... -> WHERE -> GROUP BY -> HAVING -> SELECT -> ORDER BY and you cannot use an element before it is ... lines (e.g. Java code , stack trace ) - select a style in the toolbar and then insert the text in the new created ...

 
forum_thread

TYPE Expression

Hi there! Trying to add a simple type expression with the criteria api like in your sample: cb.notEqual(e.type(), cb.literal(Country.class)); results in the error: Caused by: com.objectdb.o.UserException: Attempt to store an instance of a non persistable type java.lang.Class at com.objectdb.o.MSG.d(MSG.java:61) at com.objectdb.o.TYW.writeElement(TYW.java:223) at com.objectdb.o.QRR.l(QRR.java:424) at com.objectdb.o.QRR.g(QRR.java:230) at com.objectdb.o.QRR.b(QRR.java:151) ... either using simple string query in explorer: SELECT FROM com . test . MyEntity c WHERE TYPE ( c ) ... error whereas this works as expected: SELECT FROM com . test . MyEntity c Note that my Entity is ...

 
forum_thread

Unexpected COUNT Results

We are working with objectDB version 2.5.5.b01. (we also tried to use the latest version 2.6.1) We have several issues with queries that can be seen with the attached database and using ObjectDB explorer: 1.       Using ObjectDB explorer... explorer a.       SELECT $1.id FROM Pa3DataKey $1 WHERE $1.timestamp <= 187526 AND ... add COUNT operator: b.      SELECT COUNT($1.id) FROM Pa3DataKey $1 WHERE $1.timestamp <= 187526 AND ... e.g: c.       SELECT COUNT($1.id) FROM Pa3DataKey $1 WHERE $1.timestamp <= 187526 AND ...

 
issue

@FetchGroup in JPA similar to JDO

I was checking what's new in different JPA implementation on the market and found quite interesting two features. First of those features is described in this ticket. It's similar to FetchGroup from JDO. It works like this. First you specify attributes to fetch from database: ... TypedQuery query = em. createQuery ( "SELECT e FROM Entity e" , Entity . class ) ; query. ... query = em. createQuery ( "select e.firstName, e.lastName FROM Entity e" , Tuple . class ) ... query = em. createQuery ( "select new Entity(e.firstName, e.lastName) FROM Entity e" , Entity . ...

 
issue

Problem with JOIN and inheritance

Hello, Please run this query on the attached DB: SELECT DISTINCT $1 FROM com.quasado.serviceplaza.customer.VendorCustomer $1 JOIN $1.qubletFRAGMENTMAP $2, com.quasado.foundation.warehouse.contract.customer.CustomerContractsFragment $3 WHERE ((NOT (($2=$3) AND ($3.contracts IS EMPTY)))) The problem is quite easy: The "VendorCustomer" class inherits from the "Customer" class. ... Please run this query on the attached DB: SELECT DISTINCT $1 FROM com . quasado . serviceplaza . customer ... the "Customer" class. Now with this query I do select from "VendorCustomer" yet through using the join, he is also selecting ...

 
forum_thread

First query takes 4+ minutes to complete

Hi, we are evaluating ObjectDB 2.5.1_04 in embedded mode hoping to replace SQLite in our application. We observed that in our case it takes on average more than 4 minutes to complete the first SELECT query that we run on the DB which contains about 320,000 records of a single type of object. SQLite in comparison responds within few seconds on average with the same number of records. We hope to receive your recommendation on how to improve this result with this post.   Test System ... takes on average more than 4 minutes to complete the first SELECT query that we run on the DB which contains about 320,000 records of a ... 2. The 2nd EntityManager runs the queries (JPQL SELECT statements) shown next.  Query We test with the ...

 
forum_thread

Criteria query error: Unexpected query token

Using JPA2, I can save entities now in JBoss, and also fetch them uniquely by id. However, if I try to fetch it by getting back all instances (e.g. findAll, I get the following error:   ... : Unexpected query token 'FROM' (SELECT is expected) [Proxied because : Could not find suitable constructor] at ... It seems that the query is invalid because a SELECT is not specified. Unexpected query token 'FROM' (SELECT is ...

 
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'. ... with ORDER BY clause. I have a simple query: SELECT u FROM User u ORDER BY u . name When the name ... query token ' java ' for query: SELECT u FROM User u ORDER BY java . text . Normalizer . ...

 
tutorial

Step 3: Add a Main Class

Explains how to add the JPA tutorial Main class in Eclipse.... Query q1 = em. createQuery ( "SELECT COUNT(p) FROM Point p" ) ; System. out . println ... Query q2 = em. createQuery ( "SELECT AVG(p.x) FROM Point p" ) ; System. out . println ...

 
forum_thread

java.lang.ClassCastException in query results

I have a simple object stored in a ObjectDb file Stadium Name (java.lang.String) Capacity (int) City (java.lang.String)   When i run the following code i get the ClassCastException in the "for (Stadium result : results)" line ... query = em. createQuery ( "SELECT Name, Capacity, City FROM Stadium s" , Stadium. class ) ; ... You have to change your query from: SELECT Name , Capacity , City FROM Stadium s to ...