Package org.fryske_akademy.jpa
Class TimeView
- java.lang.Object
-
- org.fryske_akademy.jpa.TimeView
-
- All Implemented Interfaces:
Serializable,EntityInterface
@Entity public class TimeView extends Object implements EntityInterface
class to enable LocalDateTime based querying of auditing information. Accompanying postgres view, of course you may as well add a timestamp column that will be filled from your RevisionListener.create view timeview as select id, username, (to_timestamp('01-01-1970 00:00:00', 'DD-MM-YYYY HH24:MI:SS') + timestamp * interval '1 millisecond') at time zone 'cest' at time zone 'utc' as timestamp from revisioninfo; create index revuser on revisioninfo(username); create index revtime on revisioninfo(timestamp);- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description TimeView()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IntegergetId()an entity should have an idLocalDateTimegetTimestamp()StringgetUsername()booleanisTransient()is the entity in the databasevoidsetId(Integer id)voidsetTimestamp(LocalDateTime timestamp)voidsetUsername(String username)StringtoString()
-
-
-
Field Detail
-
USERS
public static final String USERS
- See Also:
- Constant Field Values
-
-
Method Detail
-
getId
public Integer getId()
Description copied from interface:EntityInterfacean entity should have an id- Specified by:
getIdin interfaceEntityInterface- Returns:
-
setId
public void setId(Integer id)
-
getUsername
public String getUsername()
-
setUsername
public void setUsername(String username)
-
getTimestamp
public LocalDateTime getTimestamp()
-
setTimestamp
public void setTimestamp(LocalDateTime timestamp)
-
isTransient
public boolean isTransient()
Description copied from interface:EntityInterfaceis the entity in the database- Specified by:
isTransientin interfaceEntityInterface- Returns:
- true when not in the database
-
-