K
- the key type.V
- the valye type.public interface CachedGroupJPAEntityRepository<K extends Serializable,V extends Serializable>
DefaultGroupJPAEntityValueManager
.DefaultGroupJPAEntityValueManager
Modifier and Type | Method and Description |
---|---|
void |
delete(K key)
This will delete a row in the table with the key and with the "group".
|
int |
deleteAll()
Delete all rows from the table with this "group"
|
int |
deleteAll(Date belowExpireDateTime)
Delete all rows from this table where "
CachedGroupJPAEntity.getExpireDateTime() " is below belowExpireDateTime and with this "group". |
CachedGroupJPAEntity<K,V> |
get(K key)
Gets a row with the key and group.
|
List<CachedGroupJPAEntity<K,V>> |
getAll()
Get all rows from the table with this "group"
|
Class<? extends CachedGroupJPAEntity<K,V>> |
getEntityClazz()
Gets the class instance of CachedGroupJPAEntity.
|
javax.persistence.EntityManagerFactory |
getEntityManagerFactory()
Gets the EntityManagerFactory.
|
String |
getGroup()
Gets the group name for this repository, is part of the ID for CachedGroupJPAEntity.
|
void |
insert(CachedGroupJPAEntity<K,V> entity)
This will insert a row in the table with the "group".
|
long |
size()
The number of rows in the table with the "group".
|
void |
updateExpireTime(K key,
Date expireDateTime)
Update the "expireDateTime" column for a key on with the "group.
|
void |
validate()
Should validate that the "entityManagerFactory" is not
null , the entity clazz is not null , and the group is not null or empty, or the entity clazz do not have a "@Entity" annotation. |
void validate() throws IllegalArgumentException, NullPointerException
null
, the entity clazz is not null
, and the group is not null
or empty, 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()
,
getGroup()
List<CachedGroupJPAEntity<K,V>> getAll() throws javax.persistence.PersistenceException
javax.persistence.PersistenceException
- if unable to get all rows.getGroup()
int deleteAll(Date belowExpireDateTime) throws javax.persistence.PersistenceException
CachedGroupJPAEntity.getExpireDateTime()
" is below belowExpireDateTime and with this "group".belowExpireDateTime
- the datetime a rows "getExpireDateTime()
" has to be below.javax.persistence.PersistenceException
- if unable to performed deletion.CommonCachedJPAEntity.getExpireDateTime()
,
getGroup()
int deleteAll() throws javax.persistence.PersistenceException
javax.persistence.PersistenceException
- if unable to performed deletion.getGroup()
CachedGroupJPAEntity<K,V> get(K key) throws javax.persistence.PersistenceException
key
- the key.null
is returned.javax.persistence.PersistenceException
- if unable to perform find.getGroup()
void insert(CachedGroupJPAEntity<K,V> entity) throws javax.persistence.PersistenceException
entity
- the entity instance.javax.persistence.PersistenceException
- if unable to perform persist.getGroup()
,
CachedGroupJPAID.setGroup(String)
void delete(K key) throws javax.persistence.PersistenceException
key
- the keyjavax.persistence.PersistenceException
- if unable to performed deletion.getGroup()
long size() throws javax.persistence.PersistenceException
javax.persistence.PersistenceException
- if unable to performed query.getGroup()
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.getGroup()
javax.persistence.EntityManagerFactory getEntityManagerFactory()
Class<? extends CachedGroupJPAEntity<K,V>> getEntityClazz()
String getGroup()
null
and none empty.Copyright © 2016. All rights reserved.