-
-
Save loomismilitia/7019b68709c908813663e774e84cf49a 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
@MappedSuperclass | |
public abstract class AbstractAuditable<U, PK extends Serializable> extends AbstractPersistable<PK> implements | |
Auditable<U, PK> { | |
// … | |
} |
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
@MappedSuperclass | |
public abstract class AbstractPersistable<PK extends Serializable> implements Persistable<PK> { | |
@Id | |
@GeneratedValue(strategy = GenerationType.AUTO) | |
private PK id; | |
// … | |
} |
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
@Entity | |
public class AuditableUser extends AbstractAuditable<AuditableUser, Long> { | |
// … | |
} |
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
interface Persistable<ID extends Serializable> extends Serializable { | |
ID getId(); | |
boolean isNew(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment