• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Spring Data JPA

 
Niall Loughnane
Ranch Hand
Posts: 208
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2
Hibernate IntelliJ IDE Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic