-->
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: Arithmetic bit operations in where clause?
PostPosted: Wed Aug 23, 2006 9:39 am 
Regular
Regular

Joined: Mon Aug 07, 2006 6:22 pm
Posts: 67
Spring 1.2.1, Hibernate 3.0.5, Oracle 9i, JDK 1.4.2.

I'll provide background on my situation in case there's a better way to do this.

I have a table which defines validations on fields on three different message types that I can process. Some of the validation entries apply to all the message types, and some apply to particular subsets of the message types.

When I'm processing a message, I need to get the list of validation entries for that message type.

From a high level, I was thinking that the message type column could be a bitmap. Bit 0 represents message type 1, bit 1 message type 2, etcetera. In order for this to work, I'd have to be able to do something like this in the query:

fv.msg_type & :msg_type: = :msg_type:

I don't see any way to do that in Hibernate (or SQL?).

If I can't do anything like this, for each row that applies to more than one message type, I'll just have to duplicate each row, except have different msg_type values. That would be annoying.


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.