About sort

manual

ORDER BY clause (JPQL / Criteria API)

Explains how to use the ORDER BY clause in a JPA/JPQL query.... Country objects ordered by currency as the primary sort key and by name as the secondary sort key: SELECT c . currency , c . name FROM Country c ...

 
forum_thread

How the sort order (in queries) works for non english letters?

We are considering using ObjectDB in  project where target audience are czech speaking people (we are Czech company). How the sort order works for international (for us 'czech') letters? Does the ordering respects the national requirements? Thank you for clarification ... ... are czech speaking people (we are Czech company). How the sort order works for international (for us 'czech') letters? Does the ... if possible. Normalizing the strings only during sort is also possible, but it is less efficient, of course. See also ...

 
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: ... expression is the same for all the result objects - the sort didn't have any effect. ObjectDB Support ...

 
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: ... / fix, this is more than a show stopper, we cannot even sort right now!! edit ...

 
issue

Sort of very large objects - out of memory

The attached test is failing with an out of memory exception when running with -Xmx512m It performs the following actions: 1) Create 5 persist threads which create and persist a large object in a loop 100 times each 2) Create 5 get threads which read 100 objects each in a loop based on object creation time and priority The message size should be around 1mb so I think there should be around 11mb of "live" data in play at any time. The objectdb cache settings are low in the config - database section is below for reference. ... , createTime could even be faster if both sort keys were either ascending or descending, since then a range query could ...

 
forum_thread

Cannot sort descending, when ordering by caluculated float in a method

Hi, I have found an issue in ordering by a method. I have two entities : Invoice and InvoiceItem. public class InvoiceItem{ ..     private float price;     private float amount; .. }   public class Invoice{ #1 2011-06-23 19:43 Hi, I have found an issue in ordering by a method. I have two entities : Invoice and InvoiceItem. public ...

 
forum_thread

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: ... else { logger. debug ( "Sort column: {}, ascending {}" , sortColumn, isAscending ) ; ... order in given way. Now, when running this query with sort column set to 'id', it takes about 9-11 seconds to render webpage: ...

 
manual

Index Definition

Describes how to define indexes in JPA entity classes and explains how indexes are used in JPQL queries.... it determines which field is used as the BTree's primary sort key and which field is used as a secondary sort key. If x is specified first, the BTree is ordered by x values, so ...

 
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 + ... - approveEmail, approvePhoneNumber, ... I can not sort them ORDER BY approveEmail , approvePhoneNumber , ... because the parameters equivalent. I want to sort them in the query by their sum ORDER BY ( ...

 
forum_thread

Attempt to open a non existing file '/tmp/objectdb_xxxx/SortQueryItr_6.mrg'

Hi, I came across an error - but i have not been able to create a simple reproducible case - the error does not happen often and does not happen always -  Let me explain: 1/ I run 5 java applications at the same time on one machine - each application is using an ODB file (each one is using a different one). Basically each application does a sorted query ( qqq = em.createQuery("SELECT bk FROM OBN bk ORDER BY bk.time ASC", OBN); ) 2/ after a little while - some of the applications throws this error message: #1 2015-02-11 03:52 Hi, I came across an error - but i have not been able to create a simple reproducible case - the error do ...