Hi graphistas,
I'd like to add a lastModified attribute on my nodes/relationships. But I'd prefer to automate the object.lastModified = new Date(); before each persist() or each save(). So is there any elegant way to update a date attribute on saving?
If not, it may be a useful feature to add to SDN. It could take the form of an annotation like this (@UpdateOnSaving):
@NodeEntity
public class Project {
@GraphId
Long id;
@Indexed
String objectId;
@UpdateOnSaving
Date lastModified;
public Project(String objectId) {
this.objectId = objectId;
}
}
I'm waiting for your thought about that.
Cheers,
Marc