Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] @OrderBy with LOWER() and other string-functions

På fredag 16. august 2013 kl. 22:28:47, skrev Andreas Joseph Krogh <andreak@xxxxxxxxxxxx>:
Hi.
 
I'm porting my app from Hibernate where having:
 
@OrderBy("LOWER(name)")
private List<ProjectComponent> components
 
works and the Component-list is ordered by ProjectComponent.name in lowercase, and a query "ORDER BY lower(name)" is generated.
 
In EL I'm getting an Exception:
 
Caused by: Exception [EclipseLink-7217] (Eclipse Persistence Services - 2.5.1.v20130814-ad1d746): org.eclipse.persistence.exceptions.ValidationException
Exception Description: The order by value [LOWER(name)], specified on the element [components] from entity [class no.officenet.origo.core.domain.model.project.Project], is invalid. No property or field with that name exists on the target entity [class no.officenet.origo.core.domain.model.project.ProjectComponent].
 
Is there a way to make EL generate a query to fetch the mapped collection sorted on a property case insensitive?
 
Thansk.
 
It appearantly works in JPQL according to this resolved bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=219814
 
Is there a reason why it doesn't work using the @OrderBy annotation?
Is there a work-around?
Shall I file a bug?
 
--
Andreas Joseph Krogh <andreak@xxxxxxxxxxxx>      mob: +47 909 56 963
Senior Software Developer / CTO - OfficeNet AS - http://www.officenet.no
Public key: http://home.officenet.no/~andreak/public_key.asc
 

Back to the top