Package org.fryske_akademy.jpa
Class TimeView
java.lang.Object
org.fryske_akademy.jpa.TimeView
- All Implemented Interfaces:
Serializable,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:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetId()an entity should have an idbooleanis the entity in the databasevoidvoidsetTimestamp(LocalDateTime timestamp) voidsetUsername(String username) toString()
-
Field Details
-
USERS
- See Also:
-
-
Constructor Details
-
TimeView
public TimeView()
-
-
Method Details
-
getId
Description copied from interface:EntityInterfacean entity should have an id- Specified by:
getIdin interfaceEntityInterface- Returns:
-
setId
-
getUsername
-
setUsername
-
getTimestamp
-
setTimestamp
-
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
-
toString
-