-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Failure executing query with criteria
PostPosted: Fri Mar 16, 2012 12:18 pm 
Newbie

Joined: Fri Mar 16, 2012 12:08 pm
Posts: 5
Hi all. I am getting the this error: org.hibernate.QueryException: could not resolve property: financialDetailType.description.longDescription of: com.arcadia.model.FinancialEvent
when this is execute:
Criteria criterio = getSession().createCriteria(FinancialEvent.class);
List results = criterio.list();

I know whats the reason but not how to fix it.

I have an entity called "FinancialDetailType" with an attribute --> private "Description description". Within Description there is an attribute called longDescription (String). So financialDetailType.description.longDescription makes sense.

When it says criterio.addOrder(org.hibernate.criterion.Order.desc(field)); and field parameter is a simple field "eg.: amount" everythink works fine. But when field parameter value is "financialDetailType.description.longDescription" I got the error wrote above.

Thats why I said I know whats the error is. Criteria doesnt like multiple field in ordering.

Any idea how to order multiple?

Thanks!!


Top
 Profile  
 
 Post subject: Re: Failure executing query with criteria
PostPosted: Mon Mar 19, 2012 1:55 pm 
Newbie

Joined: Fri Mar 16, 2012 12:08 pm
Posts: 5
up


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.