About DESC

manual

ORDER BY clause (JPQL / Criteria API)

Explains how to use the ORDER BY clause in a JPA/JPQL query.... ORDER BY Expressions Order Direction (ASC, DESC) Grouping (GROUP BY) Order ORDER BY in ... in the FROM clause . Order Direction (ASC, DESC) The default ordering direction is ascending. Therefore, when ...

 
api-jpa

desc(x)

Create an ordering by the descending value of the expression.(Method of javax.persistence.criteria.CriteriaBuilder)

 
forum_thread

Query problem after transaction commit

I have a machine running the objectdb server and the client on another machine connect to it. The client program can connect to the server and query to get all the records. However, after transaction.begin ... persist(p) .. commit of a new object, my client program can no longer retrieve the old records but only the latest stored record. I tried to run database explorer on the server machine and able to see all the records including the new stored record.... SELECT u FROM Goods u where u._code like :code AND u._desc like :desc  05> code= %, desc= % 06> UI: end query 07> UI: ...

 
forum_thread

100% CPU when using multiple BETWEEN

Hi, we are evaluating ObjectDB 2.5.1_03 in embedded mode. We have a DB of about 2800 instances of a class that has two java.lang.String members: toExtension and fromExtension. There are other members in the class, but not relevant to the problem.   A query like this cause the java process to start running at 100% CPU (endless loop) and it never recovers: ... ) ) ORDER BY r . startDate DESC , r . startTime DESC , r . channelNumber DESC   The following ...

 
api-jpa

Criteria Query Selection and Results

Reference (JavaDoc) of JPA query criteria result interfaces, including Selection, CompoundSelection, Order and Tuple.... order direction - either ascending (ASC) or descending (DESC). The CriteriaBuilder ... See JavaDoc Reference Page... and desc desc(x) CriteriaBuilder's method Create an ordering by the ...

 
forum_thread

Slow searching with two indexes

I'm running queries on a large database (tens of millions of objects), and I'm running into a performance problem using two indexes.  An entity I'm querying has two indexed fields - one is the primary key (id) and so is different for each object, and the other is an object reference that only has a few tens of different values.   When I query by just the primary key, it's (of course) extremely fast, but when I also query using the other key, queries can take minutes.... from Thing where reference == :objectReference order by id desc  With the query limited to (say) 10 results. Is there ... reference == :objectReference ORDER BY id DESC when an index is defined on the reference field should use that ...

 
forum_thread

How to convert a boolean to an int in the query?

How to convert a boolean to an int in the query? I have five parameters of type boolean in the entity object - approveEmail, approvePhoneNumper, ... I can not sort them ORDER BY approveEmail, approvePhoneNumper, .... because the parameters equivalent. I want to sort them in the query by their sum ORDER BY (approveEmail + approvePhoneNumper + ... ) But I get an exception com.objectdb.o._PersistenceException: Invalid operand type boolean for operator + ... ORDER BY ( int ) approveEmail DESC and SELECT approveEmail FROM Person ORDER BY approveEmail DESC return different results. Query SELECT ... ORDER BY ( int ) approveEmail DESC works fine. Query SELECT approveEmail FROM ...

 
forum_thread

com.objectdb.o.NLV cannot be cast to com.objectdb.o.RSV

Hello! This query is working fine SELECT DISTINCT $1 FROM ChatHistoryItem $1 JOIN $1.recipient $2 JOIN $1.sender $3 WHERE ($2.id='22afeafe-363f-4397-8553-cc5688ba142d') OR ($3.id='22afeafe-363f-4397-8553-cc5688ba142d')  ORDER BY MAX($1.createDate) DESC   but this query returns an exception "com.objectdb.o.NLV cannot be cast to com.objectdb.o.RSV" SELECT DISTINCT $1 FROM ChatHistoryItem $1 JOIN $1.recipient $2  ... ORDER BY MAX ( $1 . createDate ) DESC   but this query returns an exception ... ORDER BY MAX ( $1 . createDate ) DESC   entity object is: @ Entity ...

 
api-jpa

javax.persistence.OrderBy

Specifies the ordering of the elements of a collection valued association or element collection at the point when the association or collection is retrieved.(Annotation of JPA)

 
forum_thread

Accessiblity of attributes in entities in several OSGi-Bundles

Hello, we have a problem with enhanced entities. It is very important to solve this issue. There are three entities in two OSGi-Bundles and we execute importRequirements() in RequirementServiceImpl: __________________________________________________________ Bundle A: @Entity class ModelElementImpl { ... ;   @ Basic private String desc ;   public void setDescription ( String desc ) { this . desc = desc ; ...