ID - The primary key of the JpaEntity, most likely an Integer but could also be of a more complex type if needed.@MappedSuperclass public abstract class AbstractJpaEntity<ID> extends java.lang.Object implements JpaEntity<ID>
| Constructor and Description |
|---|
AbstractJpaEntity() |
AbstractJpaEntity(java.util.Date dateUpdated) |
AbstractJpaEntity(java.util.Date dateAdded,
java.util.Date dateUpdated) |
| Modifier and Type | Method and Description |
|---|---|
java.util.Date |
getDateAdded()
Returns the date of when the record was added
|
java.util.Date |
getDateUpdated()
Returns the date when the record was last updated
|
java.util.Date |
now()
Returns the current date
|
void |
setDateAdded(java.util.Date dateAdded) |
void |
setDateUpdated(java.util.Date dateUpdated)
Does not actually set the dateUpdated, here so that form binding will not fail.
|
void |
updateDateAdded()
Always set both dateAdded and dateUpdated to now when inserting a record
|
void |
updateDateUpdated()
Always set the dateUpdate to now when updating a record
|
public AbstractJpaEntity()
public AbstractJpaEntity(java.util.Date dateUpdated)
public AbstractJpaEntity(java.util.Date dateAdded,
java.util.Date dateUpdated)
public java.util.Date getDateAdded()
getDateAdded in interface JpaEntity<ID>public void setDateAdded(java.util.Date dateAdded)
setDateAdded in interface JpaEntity<ID>public java.util.Date getDateUpdated()
getDateUpdated in interface JpaEntity<ID>public void setDateUpdated(java.util.Date dateUpdated)
setDateUpdated in interface JpaEntity<ID>public void updateDateUpdated()
public void updateDateAdded()
public java.util.Date now()