com.atlassian.crowd.model.token
Class TokenDAOHibernate

java.lang.Object
  extended by org.springframework.dao.support.DaoSupport
      extended by org.springframework.orm.hibernate3.support.HibernateDaoSupport
          extended by com.atlassian.crowd.util.persistence.hibernate.HibernateDao
              extended by com.atlassian.crowd.model.token.TokenDAOHibernate
All Implemented Interfaces:
TokenDAO, TokenDAOPersistence, ObjectDao, org.springframework.beans.factory.InitializingBean

public class TokenDAOHibernate
extends HibernateDao
implements TokenDAO, TokenDAOPersistence


Field Summary
 
Fields inherited from class com.atlassian.crowd.util.persistence.hibernate.HibernateDao
batchProcessor, logger
 
Constructor Summary
TokenDAOHibernate()
           
 
Method Summary
 Token add(Token token)
           
 Token findByID(long ID)
           
 Token findByIdentifierHash(java.lang.String identifierHash)
           
 Token findByRandomHash(java.lang.String randomHash)
           
 java.lang.Class getPersistentClass()
          All subclasses of HibernateDAO must implement this method for HibernateDao.load(long) to work correctly
 java.util.Collection<Token> loadAll()
          TokenDAOPersistence.loadAll()
 void remove(long directoryId, java.lang.String name)
           
 void remove(Token token)
           
 void removeAccessedBefore(java.util.Date expiryTime)
           
 void removeAll()
          TokenDAOPersistence.removeAll()
 void removeAll(long directoryId)
           
 void saveAll(java.util.Collection<Token> tokens)
          TokenDAOPersistence.saveAll()
 java.util.List<Token> search(EntityQuery query)
           
 void setHqlQueryTranslater(HQLQueryTranslater hqlQueryTranslater)
           
 Token update(Token token)
           
 
Methods inherited from class com.atlassian.crowd.util.persistence.hibernate.HibernateDao
load, loadReference, remove, save, saveOrUpdate, setBatchProcessor, update
 
Methods inherited from class org.springframework.orm.hibernate3.support.HibernateDaoSupport
checkDaoConfig, convertHibernateAccessException, createHibernateTemplate, getHibernateTemplate, getSession, getSession, getSessionFactory, releaseSession, setHibernateTemplate, setSessionFactory
 
Methods inherited from class org.springframework.dao.support.DaoSupport
afterPropertiesSet, initDao
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TokenDAOHibernate

public TokenDAOHibernate()
Method Detail

findByRandomHash

public Token findByRandomHash(java.lang.String randomHash)
                       throws ObjectNotFoundException
Specified by:
findByRandomHash in interface TokenDAO
Throws:
ObjectNotFoundException

findByIdentifierHash

public Token findByIdentifierHash(java.lang.String identifierHash)
                           throws ObjectNotFoundException
Specified by:
findByIdentifierHash in interface TokenDAO
Throws:
ObjectNotFoundException

add

public Token add(Token token)
Specified by:
add in interface TokenDAO

update

public Token update(Token token)
Specified by:
update in interface TokenDAO
Parameters:
token - token to update.
Returns:
updates the last accessed date on the token (sets it to now).

remove

public void remove(Token token)
Specified by:
remove in interface TokenDAO

search

public java.util.List<Token> search(EntityQuery query)
Specified by:
search in interface TokenDAO

findByID

public Token findByID(long ID)
               throws ObjectNotFoundException
Specified by:
findByID in interface TokenDAO
Throws:
ObjectNotFoundException

remove

public void remove(long directoryId,
                   java.lang.String name)
Specified by:
remove in interface TokenDAO

removeAll

public void removeAll(long directoryId)
Specified by:
removeAll in interface TokenDAO

getPersistentClass

public java.lang.Class getPersistentClass()
Description copied from class: HibernateDao
All subclasses of HibernateDAO must implement this method for HibernateDao.load(long) to work correctly

Specified by:
getPersistentClass in interface ObjectDao
Specified by:
getPersistentClass in class HibernateDao
Returns:
Class

loadAll

public java.util.Collection<Token> loadAll()
TokenDAOPersistence.loadAll()

Specified by:
loadAll in interface TokenDAOPersistence
Returns:
Collection of all active tokens.

saveAll

public void saveAll(java.util.Collection<Token> tokens)
TokenDAOPersistence.saveAll()

Specified by:
saveAll in interface TokenDAOPersistence
Parameters:
tokens - all tokens to add.

removeAll

public void removeAll()
TokenDAOPersistence.removeAll()

Specified by:
removeAll in interface TokenDAO
Specified by:
removeAll in interface TokenDAOPersistence

removeAccessedBefore

public void removeAccessedBefore(java.util.Date expiryTime)
Specified by:
removeAccessedBefore in interface TokenDAO

setHqlQueryTranslater

public void setHqlQueryTranslater(HQLQueryTranslater hqlQueryTranslater)


Copyright © 2009 Atlassian Pty Ltd. All Rights Reserved.