-->
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.  [ 1 post ] 
Author Message
 Post subject: bit operations in HQL
PostPosted: Wed Dec 05, 2007 6:27 am 
Newbie

Joined: Sun Feb 05, 2006 6:24 pm
Posts: 7
Hibernate version:
hibernate 3.2 ga
MySQL5.0

I want to retrieve objects with a given bit set to 1 in a byte property...

is it somehow possible to perform bit operations in the where clause?

like:

from EcEntityAccess ec where ec.ecEntityByIdSubject.ebtEntityType = 2
and ec.ecEntityByIdPrincipal = :principal
and (ec.accessflags & :flags) > 0

In MySQL bit operations seem to be possible, but when i try it in HQL i get a org.hibernate.QueryException:

org.hibernate.QueryException: unexpected char: '&' [from net.empego.core.hbm.EcEntityAccess ec where ec.ecEntityByIdSubject.ebtEntityType = 2
and ec.ecEntityByIdPrincipal = :principal
and (ec.accessflags & :flags) > 0

Any idea for a solution or a workaround!?

thanks for help,
thomas


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

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.