hibernate - HQL where clause 'greater than' with jadira PersistentDateTimeWithZone -
i'm using jadira persistentdatetimewithzone store joda datetime timezone. works expected, except searching dates using ">=" - compares time timezone string in clause (see sql @ bottom). there way further refine annotaion or hql prevent this, or bug in jadira
@type(type = "org.jadira.usertype.dateandtime.joda.persistentdatetimewithzone") @columns(columns={@column(name="departuredate", nullable = false),@column(name="departuredatetimezone", nullable = false)}) private datetime depscheduled; my hql query in jparepository:
/** * things depart after given date */ @query("select e mytable e depscheduled>=?1") list<mytable> loaddatfrommytable(datetime depdate); the generated sql - see trying compare both date , timezone string (:
hibernate: select x.departuredate departur5_4_, x.departuredatetimezone departur6_4_, mytable x , crewroster0_.departuredate>=? , crewroster0_.departuredatetimezone>=?
the type hibernate compositetype (like of jadira multicolumn types). lets query on components of type. type 2 components are: 'datetime' , 'offset', therefore, try referring component within type depscheduled.datetime.
there discussion of compositetypes at: http://learningviacode.blogspot.co.uk/2011/09/creating-hibernate-custom-type-2.html
Comments
Post a Comment