Hi,
I am a newbie with HQL (or SQL for that matter) and am having trouble executing the following query.
Code:
from com.services.DiagnosisGuide as diag where case when :descriptionPrevious is null then diag.lastDescription.description is null else diag.lastDescription.description = :descriptionPrevious end
I get the following error
Code:
unexpected token: is near line 1, column 140
What I want to be able to do is if (Parameter) :descriptionPrevious is null than I want to retrive all records for which diag.lastDescription.description is null other wise I want to get all records where descriptionPrevious is equal to diag.lastDescription.description. Any help with be greatly appreciated. Thank you
I am using
jboss version 4.02
MySql
Hibernate 3.0.5