How to create a db neutral orderby returned data in active-objects

I have an AO entity with lifecycle info like 'created' (Timestamp type) and a data entity that extends it. I want to use AO to retrieve the data entities, ordered with most recent dates first. If I try the following:

MyObj[] = aoService.find(MyObj.class,query);

I get: ERROR: column "created" does not exist Position: 58 at org.apache.velocity.runtime.parser.node.ASTMethod.execute(

But, the table does have a Timestamp column, A bug possibly? Even if this worked, Im curious how I would indicate 'ascending' or 'descending' orders.

Anyone got an example to hand?


2 answers

1 accepted

0 vote

It looks like a case sensitivity issue to me. Some database are case sensitive, Postgres being one of them. And all table and column names converted by the AO plugin are upper case.

See the table names and column names conventions for more information.

In your case I think simply changing your code to the following should work."CREATED")

Hi Sam, I should have thought of that, upper casing worked. If AO coverts all columns to upper case, it would be a wrinkle removed if column operations shouldnt be case sensitive?

0 vote

Andy, you should be able to do"created asc")"created desc")

Try it, if that's not working then there may be a bug

Hi James,

Thanks for that, looks like the fundamental problem is the inheritance, logged as

Suggest an answer

Log in or Join to answer
Community showcase
Jason Wong
Published 4 hours ago in Agility Beta

Welcome to agility

Every team in the world is unique, and so   Atlassian believes   that each and every team's best way of working  needs to  be molded to their unique circumstances  – ...

33 views 1 5
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot