edu.nrao.sss.dao.project
Class HibernateProjectDao

java.lang.Object
  extended by edu.nrao.sss.dao.HibernateDao
      extended by edu.nrao.sss.dao.project.HibernateProjectDao
All Implemented Interfaces:
ProjectProvider

public class HibernateProjectDao
extends HibernateDao
implements ProjectProvider

A Hibernate data access object for Projects.

Since:
2006-02-24
Version:
1.1

Field Summary
 
Fields inherited from class edu.nrao.sss.dao.HibernateDao
factories
 
Constructor Summary
HibernateProjectDao()
          empty no-arg constructor
HibernateProjectDao(String cfg, org.hibernate.Interceptor i)
           
 
Method Summary
 void cancelChanges(Project p)
          This method actually closes the whole HibernateSession! ALL changes not saved using the active session object are lost, whether they pertain to this one project or not!
 void delete(Project project)
          Silently ignores being passed null and transient objects.
 void deleteById(long id)
           
 Project findByCode(String code)
           
 Project findById(long id)
           
 List<Project> findByUserId(long uid)
           
 List<Project> findProjects(EventSetStatus status)
           
 List<Project> findProjects(Long userId, EventSetStatus status)
           
 List<Project> findProjects(Long userId, String proposalCode)
          Returns a (possibly empty, but non-null) List of Projects that are editable by userId and have a proposal code of proposalCode
 List<Project> findTestProjects(Long userId)
           
 List<Project> getAllProjects()
           
 void removeOrphanedScans()
           
 void save(Project project)
           
 
Methods inherited from class edu.nrao.sss.dao.HibernateDao
addDaoListener, beginTransaction, closeSession, commitTransaction, destroyAllFactories, destroyFactory, fireRollbackEvent, getConfigurationFileName, getInterceptor, getSession, getSessionFactory, removeDaoListeners, rollbackTransaction, setConfigurationFileName, setInterceptor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HibernateProjectDao

public HibernateProjectDao()
empty no-arg constructor

See Also:
HibernateDao

HibernateProjectDao

public HibernateProjectDao(String cfg,
                           org.hibernate.Interceptor i)
See Also:
HibernateDao
Method Detail

findById

public Project findById(long id)
                 throws RepositoryException
Specified by:
findById in interface ProjectProvider
Returns:
null if a Project with the provided id doesn't exist.
Throws:
RepositoryException

findByCode

public Project findByCode(String code)
                   throws RepositoryException
Specified by:
findByCode in interface ProjectProvider
Returns:
null if a Project with the provided code doesn't exist.
Throws:
RepositoryException
See Also:
ProjectProvider.findByCode(String)

findByUserId

public List<Project> findByUserId(long uid)
                           throws RepositoryException
Specified by:
findByUserId in interface ProjectProvider
Returns:
a List (possibly empty) of Projects that uid is an editor of. This method does not return null.
Throws:
RepositoryException

findProjects

public List<Project> findProjects(Long userId,
                                  String proposalCode)
                           throws RepositoryException
Returns a (possibly empty, but non-null) List of Projects that are editable by userId and have a proposal code of proposalCode

Specified by:
findProjects in interface ProjectProvider
Throws:
RepositoryException

findTestProjects

public List<Project> findTestProjects(Long userId)
                               throws RepositoryException
Specified by:
findTestProjects in interface ProjectProvider
Throws:
RepositoryException

findProjects

public List<Project> findProjects(EventSetStatus status)
                           throws RepositoryException
Specified by:
findProjects in interface ProjectProvider
Throws:
RepositoryException

findProjects

public List<Project> findProjects(Long userId,
                                  EventSetStatus status)
                           throws RepositoryException
Specified by:
findProjects in interface ProjectProvider
Throws:
RepositoryException

removeOrphanedScans

public void removeOrphanedScans()
                         throws RepositoryException
Throws:
RepositoryException

getAllProjects

public List<Project> getAllProjects()
                             throws RepositoryException
Specified by:
getAllProjects in interface ProjectProvider
Throws:
RepositoryException

save

public void save(Project project)
          throws RepositoryException
Throws:
RepositoryException

deleteById

public void deleteById(long id)
                throws RepositoryException
Throws:
RepositoryException

delete

public void delete(Project project)
            throws RepositoryException
Silently ignores being passed null and transient objects.

Throws:
RepositoryException

cancelChanges

public void cancelChanges(Project p)
                   throws RepositoryException
This method actually closes the whole HibernateSession! ALL changes not saved using the active session object are lost, whether they pertain to this one project or not!

Throws:
RepositoryException


Copyright © 2009. All Rights Reserved.