com.atlassian.crowd.openid.server.model
Class HibernateDao

java.lang.Object
  extended by org.springframework.dao.support.DaoSupport
      extended by org.springframework.orm.hibernate3.support.HibernateDaoSupport
          extended by com.atlassian.crowd.openid.server.model.HibernateDao
All Implemented Interfaces:
ObjectDao, org.springframework.beans.factory.InitializingBean
Direct Known Subclasses:
EntityObjectDAOHibernate

public abstract class HibernateDao
extends org.springframework.orm.hibernate3.support.HibernateDaoSupport
implements ObjectDao


Field Summary
protected  org.apache.log4j.Logger logger
           
 
Constructor Summary
HibernateDao()
           
 
Method Summary
abstract  java.lang.Class getPersistentClass()
          All subclasses of HibernateDAO must implement this method for load(long) to work correctly
 java.lang.Object load(long ID)
          Loads a persistnce DAO object from the persistence store.
 java.lang.Object loadReference(long id)
          This method calls the session.load method to obtain a proxy (or actual instance if the object is in session) by NOT hitting the database immediately.
 void remove(java.lang.Object persistentObject)
          Removes the DAO object from the persistence store.
 void save(java.lang.Object persistentObject)
          Saves a new DAO object to the persistence store.
 void saveOrUpdate(java.lang.Object persistentObject)
          Saves or updates DAO object to the persistence store.
 void update(java.lang.Object persistentObject)
          Updates an existing DAO object, if the object does not exist it will be added to the persistence store.
 
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
 

Field Detail

logger

protected final org.apache.log4j.Logger logger
Constructor Detail

HibernateDao

public HibernateDao()
Method Detail

save

public void save(java.lang.Object persistentObject)
          throws org.springframework.dao.DataAccessException
Saves a new DAO object to the persistence store.

Specified by:
save in interface ObjectDao
Parameters:
persistentObject - The object to save.
Throws:
org.springframework.dao.DataAccessException - A persistence exception has occurred.

saveOrUpdate

public void saveOrUpdate(java.lang.Object persistentObject)
                  throws org.springframework.dao.DataAccessException
Saves or updates DAO object to the persistence store.

Parameters:
persistentObject - The object to save or update.
Throws:
org.springframework.dao.DataAccessException - A persistence exception has occurred.

update

public void update(java.lang.Object persistentObject)
            throws org.springframework.dao.DataAccessException
Updates an existing DAO object, if the object does not exist it will be added to the persistence store.

Specified by:
update in interface ObjectDao
Parameters:
persistentObject - The object to update.
Throws:
org.springframework.dao.DataAccessException - A persistence exception has occurred.

remove

public void remove(java.lang.Object persistentObject)
            throws org.springframework.dao.DataAccessException
Removes the DAO object from the persistence store.

Specified by:
remove in interface ObjectDao
Parameters:
persistentObject - The object to remove.
Throws:
org.springframework.dao.DataAccessException - A persistence exception has occurred.

load

public java.lang.Object load(long ID)
                      throws ObjectNotFoundException
Loads a persistnce DAO object from the persistence store.

Specified by:
load in interface ObjectDao
Parameters:
ID - The unique identifier of the object to load from the persistence store.
Returns:
The populated object from the database.
Throws:
ObjectNotFoundException - if the given object with ID for the persistent class does not exist

loadReference

public java.lang.Object loadReference(long id)
This method calls the session.load method to obtain a proxy (or actual instance if the object is in session) by NOT hitting the database immediately. Do NOT call this method unless you are SURE that the object with the supplied identifier exists.

Parameters:
id - unique identifier to load.
Returns:
a proxy object (or actual instance if the object is in session)

getPersistentClass

public abstract java.lang.Class getPersistentClass()
All subclasses of HibernateDAO must implement this method for load(long) to work correctly

Specified by:
getPersistentClass in interface ObjectDao
Returns:
Class


Copyright © 2010 Atlassian. All Rights Reserved.