Message Boards

Multiply "order by" tags

Jacques Merette, modified 3 Years ago.

Multiply "order by" tags

New Member Posts: 16 Join Date: 1/8/16 Recent Posts
Hi, It sounds like you can have only one "particular order" in a service entity service.  What do you do if you need a second ordering? Do I need to create a second entity for the same table? Maybe a custom sql querie is a better solution....MErci!
thumbnail
David H Nebinger, modified 3 Years ago.

RE: Multiply "order by" tags

Liferay Legend Posts: 14916 Join Date: 9/2/06 Recent Posts
The single order by in service.xml is the default one.

The persistence layer allows for passing in custom order by comparator instances, so you all need to do is add a method to your XxxLocalServiceImpl to expose a method that passes a different comparator to the XxxPersistenceImpl class.
Jacques Merette, modified 3 Years ago.

RE: Multiply "order by" tags

New Member Posts: 16 Join Date: 1/8/16 Recent Posts
That is smart.  Thanks!!!!!!