use of com.spaceprogram.simplejpa.model.Timestamped in project simplejpa by appoxy.
the class SomeEntityListener method preUpdate.
@PreUpdate
public void preUpdate(Object object) {
System.out.println("preUpdate.");
if (object instanceof Timestamped) {
System.out.println("Setting timestamps.");
Timestamped timestamped = (Timestamped) object;
timestamped.setUpdated(new Date());
}
}
use of com.spaceprogram.simplejpa.model.Timestamped in project simplejpa by appoxy.
the class SomeEntityListener method prePersist.
@PrePersist
public void prePersist(Object object) {
System.out.println("prePersist");
if (object instanceof Timestamped) {
System.out.println("Setting timestamps.");
Timestamped timestamped = (Timestamped) object;
Date now = new Date();
timestamped.setCreated(now);
timestamped.setUpdated(now);
}
}
Aggregations