Created
June 24, 2010 02:06
-
-
Save edipofederle/450872 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.Serializable; | |
import java.util.Date; | |
import javax.persistence.Entity; | |
import javax.persistence.Id; | |
import javax.persistence.PrePersist; | |
import javax.persistence.PreUpdate; | |
@Entity | |
public class Product implements Serializable { | |
@Id | |
private Integer id; | |
private String nome; | |
private String desricao; | |
private Date created; | |
private Date updated; | |
@PrePersist | |
protected void onCreate() { | |
created = new Date(); | |
} | |
@PreUpdate | |
protected void onUpdate() { | |
updated = new Date(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment