File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Spring and the fly likes Spring Data JPA Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Spring Data JPA" Watch "Spring Data JPA" New topic

Spring Data JPA

Niall Loughnane
Ranch Hand

Joined: Dec 07, 2006
Posts: 208

i am integrating Spring Data JPA into a project but have come across an issue,

In there is a method "save",

but when the method "save" is called i need to set 2 date fields on the object that is being saved,

is this possible in Spring Data JPA?


Petri Kainulainen

Joined: Dec 29, 2012
Posts: 2

You can use the entity callback methods for this purpose. The Hibernate reference documentation has a good description about this. In your case, your entity class would look like this:

I agree. Here's the link:
subject: Spring Data JPA
It's not a secret anymore!