@MappedSuperclass public class AbstractEntity extends Object implements EntityInterface
GenerationType.IDENTITY), a version column and a function to check if the entity is transient (not in db yet).
Jpa annotations are on getters which allows you to override. If you want to annotate fields in your subclasses be sure to annotate with
AccessType.FIELD.| Constructor and Description |
|---|
AbstractEntity() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
Integer |
getId()
an entity should have an id
|
int |
getVersion() |
int |
hashCode() |
boolean |
isTransient()
is the entity in the db?
|
void |
setId(Integer id) |
void |
setVersion(int version) |
public Integer getId()
EntityInterfacegetId in interface EntityInterfacepublic void setId(Integer id)
public int getVersion()
public void setVersion(int version)
public boolean isTransient()
Copyright © 2018 Fryske Akademy. All rights reserved.