I have a postgres database that has a table "draft"
containing a column set_up_time, saved as a timestamp:
@Column(nullable = false)
@Type(type = "org.jadira.usertype.dateandtime.joda.PersistentLocalDateTime")
LocalDateTime setUpTime;
For certain reasons I need to keep this structure as it is. However I am expecting database queries searching for records, for setUpTime as LocalDateTime and setUpTime as LocalDate
. How can I map it in a way, that hibernate queries the database with both these types for setUpTime, and returns the results accordingly?
The schema I am using is :
"create table draft (dtype varchar(31) not null, id int8 not null, creation_time timestamp not null, cust_ord varchar(1), description varchar(255), amount decimal(12, 2), user varchar(6), txn_time timestamp, text1from varchar(36), text2from varchar(36), text3from varchar(36), primary key (id))"