@Entity public abstract class AAuditableJPA extends Object implements IAuditable, Serializable
| Modifier and Type | Field and Description |
|---|---|
protected String |
creator |
protected String |
id |
protected String |
liveFrom |
protected String |
liveTo |
protected String |
updater |
protected long |
utcTimestamp |
DEFAULT_LIVE_TO| Constructor and Description |
|---|
AAuditableJPA() |
| Modifier and Type | Method and Description |
|---|---|
void |
close(Instant now,
String user)
Method that closes an entry
|
boolean |
equals(Object o) |
String |
getCreator()
Get the creator of the record
|
String |
getId()
The unique id of the auditable object
|
String |
getLiveFrom()
Get the string representation of the live from date of the adjustment.
|
String |
getLiveTo()
Get the string representation of the live to date of the adjustment.
|
String |
getUpdater()
Get the updater of the record
|
long |
getUtcTimestamp()
Get the UTC timestamp of the record in milliseconds
|
int |
hashCode() |
boolean |
isOpen()
Check whether an entry is open or closed
|
void |
open(Instant now,
String user)
Method that creates a new entry
|
void |
setAsNew()
Method used specifically for updates; for instance you can set the id of the entry to 'null' so
that a new id is generated when the update entry is created.
|
void |
setCreator(String creator)
Set the creator of the record
|
void |
setId(String id)
Set the unique id of the auditable object
|
void |
setLiveFrom(String liveFrom)
Set the string representation of the live from date of the adjustment.
|
void |
setLiveTo(String liveTo)
Set the string representation of the live to date of the adjustment.
|
void |
setUpdater(String updater)
Set the creator of the record
|
void |
setUtcTimestamp(long utcTimestamp)
Set the UTC timestamp of the record in milliseconds
|
protected String id
protected String liveFrom
protected String liveTo
protected String creator
protected String updater
protected long utcTimestamp
public String getId()
IAuditablegetId in interface IAuditablepublic void setId(String id)
IAuditablesetId in interface IAuditableid - the idpublic String getLiveFrom()
IAuditablegetLiveFrom in interface IAuditablepublic void setLiveFrom(String liveFrom)
IAuditablesetLiveFrom in interface IAuditableliveFrom - the string representation of the live from datepublic String getLiveTo()
IAuditablegetLiveTo in interface IAuditablepublic void setLiveTo(String liveTo)
IAuditablesetLiveTo in interface IAuditableliveTo - the string representation of the live to datepublic String getCreator()
IAuditablegetCreator in interface IAuditablepublic void setCreator(String creator)
IAuditablesetCreator in interface IAuditablecreator - the creatorpublic String getUpdater()
IAuditablegetUpdater in interface IAuditablepublic void setUpdater(String updater)
IAuditablesetUpdater in interface IAuditableupdater - the updaterpublic long getUtcTimestamp()
IAuditablegetUtcTimestamp in interface IAuditablepublic void setUtcTimestamp(long utcTimestamp)
IAuditablesetUtcTimestamp in interface IAuditableutcTimestamp - the UTC timestamp in millisecondspublic void open(Instant now, String user)
IAuditableopen in interface IAuditablenow - the UTC timestamp in milliseconds of the current instantuser - the user idpublic void setAsNew()
IAuditablesetAsNew in interface IAuditablepublic void close(Instant now, String user)
IAuditableclose in interface IAuditablenow - the UTC timestamp in milliseconds of the current instantuser - the userpublic boolean isOpen()
IAuditableisOpen in interface IAuditableCopyright © 2019. All rights reserved.