In order to record the time class is created, in adding the private domain classes Date createdAt fields, and add the method in the domain classes:
@ PrePersistsee online, @ Prepersist annotation methods seem to be in the Repository. The save () method is called before execution,
Public void createdAt () {
Enclosing createdAt=new Date ();
}
My class in the field of the Controller class using a no-parameter constructor generated in the field of class object, and then use the ReactiveCrudRepository save method to save domain object to a database, but I found that saved to the document in the database no time fields,
Is there a way to make application for domain classes automatically set the time?