Here's what we want to do: Using JPQL (avoiding native SQL), we want to include inside the generated SQL INSERT statement the Oracle SYSDATE function. So when Oracle sees the INSERT statement with the SYSDATE it will convert it to current time before it does the insert.
Here's where it gets complex: the field that uses the SYSDATE function that we want to send in the INSERT statement, that's also the field we want to use for optimistic locking (@Version). HQL, JPQL, code, annotations, we don't care how we need to implement it...all we want to do is avoid native SQL AND utilize Hibernate's built in optimistic locking features.
I hope this makes sense. I'm not optmistic that we'll find a solution, but I thought I'd ask the experts.
Thanks.
|