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..
|