-->
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: Filtering of data using Filters
PostPosted: Wed Sep 24, 2008 10:49 am 
Newbie

Joined: Fri Sep 12, 2008 11:22 pm
Posts: 4
I have a table in which I keep the 'user instructions' for a user. Now this table can also have one column for language. The table structure will be like following..

UserID UserInstruction LanguageID
1 Instruction1 1
1 Instruction2 2
1 Instruction3 3
2 Instruction1 1
2 Instruction2 2
3 Instruction3 3

The requirement is when user passes the language ID the instruction for that language id should be retrieved. I was using the hibernate filter for the same.

@org.hibernate.annotations.FilterDef(name = "languageOptions", parameters = { @org.hibernate.annotations.ParamDef(name = "languageIdValue", type = "int") })

But now the requirement is that if the instruction for that language is not found then I should return the default instruction that is for language id 1. Can I still handle it in filters? Any pointers..


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 03, 2008 2:59 am 
Newbie

Joined: Fri Oct 03, 2008 2:30 am
Posts: 16
Location: Neuchâtel, Switzerland
You can handle it with the filter as long as you can express your requirements in the condition SQL statement...


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.