Looking for suggestions for an efficient way to maintain basic audit fields for entities in AppEngine for Java (via objectify). The @PrePersist attribute looks like a good option for various date fields (dateCreated, dateModified, dateDeleted) but I’m also looking to store the ID of the user who created, modified, deleted the entity as well. Is this best left to the data access layer?
Looking for suggestions for an efficient way to maintain basic audit fields for entities
Share
If you need to store records with more than just the dates you mention you probably want to create an audit object and use @Embed to store it inside of the objects you’re auditing. Then use @PrePersist to update this object. That will give you a consistent audit framework across objects.