Hey man, thanks for the response, but I am already doing that, and that is the reason for my post. This is what hibernate logs are spewing out.....
Code:
Hibernate: select this_.POLICY_ID as POLICY1_10_1_, this_.APPLICATION_ID as APPLICAT2_10_1_, this_.PROXY_ENTITY as PROXY3_10_1_, this_.WORKING_ENTITY as WORKING4_10_1_, this_.EMPLOYER_ENTITY as EMPLOYER5_10_1_, this_.FULL_NAME as FULL6_10_1_, this_.DATE_OF_BIRTH as DATE7_10_1_, this_.QUOTE_DATE as QUOTE8_10_1_, this_.QUOTE_EXPIRY_DATE as QUOTE9_10_1_, this_.STAT_CD as STAT10_10_1_, statuscode2_.STAT_CD as STAT1_8_0_, statuscode2_.DESCR as DESCR8_0_ from (
select a.PROXY_ENTITY as PROXY_ENTITY, a.WORKING_ENTITY as WORKING_ENTITY, a.EMPLOYER_ENTITY as
EMPLOYER_ENTITY, a.APPL_ID as APPLICATION_ID, p.COMP_ID as POLICY_ID, ae.FIRST_NAME || ' ' || ae.LAST_NAME
as FULL_NAME, ae.DATE_OF_BIRTH as DATE_OF_BIRTH, c.EFFECTIVE_FROM as QUOTE_DATE, c.EFFECTIVE_TO as
QUOTE_EXPIRY_DATE, a.STAT_CD as STAT_CD from "NB_APPLICATION" a, "NB_APP_ENTITY" ae, "NB_STATUS_CODE" sc,
"NB_POLICY_GRP" pg, "NB_GROUP_COMP_CONN" p, "NB_COMPONENT" c where a.APPL_ID = ae.APPL_ID and a.STAT_CD =
sc.STAT_CD and ae.DEFAULT_ROLE = 'PP' and a.APPL_ID = pg.APPL_ID and p.GROUP_ID = pg.GROUP_ID and p.COMP_ID
= c.COMPONENT_ID
) this_ left outer join NB_STATUS_CODE statuscode2_ on this_.STAT_CD=statuscode2_.STAT_CD where this_.DATE_OF_BIRTH=?
DEBUG - NullableType.nullSafeSet(80) | binding '27 April 1977' to parameter: 1
--
as you can see at the end, it reckons it's binding to parameter value '27 April 1977' .
Substitute this directly in the query in a DB ( just to say I did it )
Code:
select ..........
) this_ left outer join NB_STATUS_CODE statuscode2_ on this_.STAT_CD=statuscode2_.STAT_CD where this_.DATE_OF_BIRTH='27 April 1977'
And as you would expect I get "wrong data type" error message, hovever put this in...
Code:
select ..........
) this_ left outer join NB_STATUS_CODE statuscode2_ on this_.STAT_CD=statuscode2_.STAT_CD where this_.DATE_OF_BIRTH='1977-04-27'
and hey presto it works like a charm....
So I really don't understand why it's such a headache... hibernate is supposed to make my life easier...aaaargh!