I have to auto generate timestamp when I am creating a new record and auto generate modified timestamp when I update a record.
can anybody tell me how do I implement this. I am using openJPA.
thanks in advance.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The easiest is to use @Version annotation (documentation here)
Just add the following to your entities:
And it will do it automatically