This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Spring Data JPA" Watch "Spring Data JPA" New topic
Author

Spring Data JPA

Niall Loughnane
Ranch Hand

Joined: Dec 07, 2006
Posts: 203
Hi,

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

In org.springframework.data.repository.CrudRepository 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?

Thanks,

Niall
Petri Kainulainen
Greenhorn

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: http://aspose.com/file-tools
 
subject: Spring Data JPA
 
Similar Threads
Webpage not opening in eclipse
which technology
Newbie Question--Hibernate will not persist
XML name space error in Spring data JPA hibernate applicationContext.xml
Spring, JPA and Albert Einstein