Class HibernateConfluenceBandanaRecordDao
- java.lang.Object
-
- com.atlassian.confluence.setup.bandana.persistence.dao.hibernate.HibernateConfluenceBandanaRecordDao
-
- All Implemented Interfaces:
ConfluenceBandanaRecordDao
public class HibernateConfluenceBandanaRecordDao extends Object implements ConfluenceBandanaRecordDao
-
-
Constructor Summary
Constructors Constructor Description HibernateConfluenceBandanaRecordDao(org.hibernate.SessionFactory sessionFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
countWithKey(String key)
Count entry in DB which have particular key.Iterable<ConfluenceBandanaRecord>
findAllWithKey(String key)
Returns all records that have a certain key, regardless of context.Collection
findForContext(String context)
Return all the records for the given context.Iterable<String>
findKeysForContext(String context)
Returns all keys for the given context.ConfluenceBandanaRecord
getRecord(String context, String key)
Retrieve a record for the given key, return null if no record existsvoid
remove(ConfluenceBandanaRecord record)
Remove a record by matching its key (context, key)void
removeAllInContext(String context)
Remove all the records belonging to the given contextvoid
saveOrUpdate(ConfluenceBandanaRecord record)
Save the record, updating it if it already exists.
-
-
-
Method Detail
-
saveOrUpdate
public void saveOrUpdate(ConfluenceBandanaRecord record)
Description copied from interface:ConfluenceBandanaRecordDao
Save the record, updating it if it already exists.- Specified by:
saveOrUpdate
in interfaceConfluenceBandanaRecordDao
- Parameters:
record
- the ConfluenceBandanaRecord to update
-
getRecord
public ConfluenceBandanaRecord getRecord(String context, String key)
Description copied from interface:ConfluenceBandanaRecordDao
Retrieve a record for the given key, return null if no record exists- Specified by:
getRecord
in interfaceConfluenceBandanaRecordDao
- Returns:
- the matching record, or null
-
remove
public void remove(ConfluenceBandanaRecord record)
Description copied from interface:ConfluenceBandanaRecordDao
Remove a record by matching its key (context, key)- Specified by:
remove
in interfaceConfluenceBandanaRecordDao
-
removeAllInContext
public void removeAllInContext(String context)
Description copied from interface:ConfluenceBandanaRecordDao
Remove all the records belonging to the given context- Specified by:
removeAllInContext
in interfaceConfluenceBandanaRecordDao
-
findForContext
public Collection findForContext(String context)
Description copied from interface:ConfluenceBandanaRecordDao
Return all the records for the given context. Returns an empty collection if no records are found.- Specified by:
findForContext
in interfaceConfluenceBandanaRecordDao
-
findKeysForContext
public Iterable<String> findKeysForContext(String context)
Description copied from interface:ConfluenceBandanaRecordDao
Returns all keys for the given context.- Specified by:
findKeysForContext
in interfaceConfluenceBandanaRecordDao
-
countWithKey
public long countWithKey(String key)
Description copied from interface:ConfluenceBandanaRecordDao
Count entry in DB which have particular key. It could help to determine how big the data is- Specified by:
countWithKey
in interfaceConfluenceBandanaRecordDao
- Returns:
- number of record in DB
-
findAllWithKey
public Iterable<ConfluenceBandanaRecord> findAllWithKey(String key)
Description copied from interface:ConfluenceBandanaRecordDao
Returns all records that have a certain key, regardless of context. Calling this method is likely to be inefficient, and shouldn't be used unnecessarily.- Specified by:
findAllWithKey
in interfaceConfluenceBandanaRecordDao
- Parameters:
key
- the bandana key to look up
-
-