K - the key type.V - the value type.public interface CachedJPAEntityRepository<K extends Serializable,V extends Serializable>
DefaultJPAEntityValueManager.DefaultJPAEntityValueManager| Modifier and Type | Method and Description |
|---|---|
void |
delete(K key)
This will delete a row in the table with the key.
|
int |
deleteAll()
Delete all rows from the table.
|
int |
deleteAll(Date belowExpireDateTime)
Delete all rows from this table where "
CachedJPAEntity.getExpireDateTime()" is below belowExpireDateTime. |
CachedJPAEntity<K,V> |
get(K key)
Gets a row with the key.
|
List<CachedJPAEntity<K,V>> |
getAll()
Get all rows from the table
|
Class<? extends CachedJPAEntity<K,V>> |
getEntityClazz()
Gets the class instance of CachedJPAEntity.
|
javax.persistence.EntityManagerFactory |
getEntityManagerFactory()
Gets the EntityManagerFactory.
|
void |
insert(CachedJPAEntity<K,V> entity)
This will insert a row in the table.
|
long |
size()
The number of rows in the table
|
void |
updateExpireTime(K key,
Date expireDateTime)
Update the "expireDateTime" column for a key.
|
void |
validate()
Should validate that the "entityManagerFactory" is not
null and the entity clazz is not null or the entity clazz do not have a "@Entity" annotation. |
void validate()
throws IllegalArgumentException,
NullPointerException
null and the entity clazz is not null or the entity clazz do not have a "@Entity" annotation.IllegalArgumentException - if either of the above conditions is not true.NullPointerException - if either of the above conditions is not true.getEntityClazz(),
getEntityManagerFactory()List<CachedJPAEntity<K,V>> getAll() throws javax.persistence.PersistenceException
javax.persistence.PersistenceException - if unable to get all rows.int deleteAll(Date belowExpireDateTime) throws javax.persistence.PersistenceException
CachedJPAEntity.getExpireDateTime()" is below belowExpireDateTime.belowExpireDateTime - the datetime a rows "getExpireDateTime()" has to be below.javax.persistence.PersistenceException - if unable to performed deletion.CommonCachedJPAEntity.getExpireDateTime()int deleteAll()
throws javax.persistence.PersistenceException
javax.persistence.PersistenceException - if unable to performed deletion.CachedJPAEntity<K,V> get(K key) throws javax.persistence.PersistenceException
key - the key.null is returned.javax.persistence.PersistenceException - if unable to perform find.void insert(CachedJPAEntity<K,V> entity) throws javax.persistence.PersistenceException
entity - the entity instance.javax.persistence.PersistenceException - if unable to perform persist.void delete(K key) throws javax.persistence.PersistenceException
key - the keyjavax.persistence.PersistenceException - if unable to performed deletion.long size() throws javax.persistence.PersistenceException
javax.persistence.PersistenceException - if unable to performed query.void updateExpireTime(K key, Date expireDateTime) throws javax.persistence.PersistenceException
key - the key.expireDateTime - the new expire datetime for the key.javax.persistence.PersistenceException - if unable to perform update.javax.persistence.EntityManagerFactory getEntityManagerFactory()
Class<? extends CachedJPAEntity<K,V>> getEntityClazz()
Copyright © 2016. All rights reserved.