edu.nrao.sss.dao.proposal
Class HibernateProposalDao

java.lang.Object
  extended by edu.nrao.sss.dao.HibernateDao
      extended by edu.nrao.sss.dao.proposal.HibernateProposalDao

public class HibernateProposalDao
extends HibernateDao

A Hibernate data access object for Proposals.

Since:
2006-02-24
Version:
1.1

Field Summary
 
Fields inherited from class edu.nrao.sss.dao.HibernateDao
factories
 
Constructor Summary
HibernateProposalDao()
          empty no-arg constructor
HibernateProposalDao(String cfg, org.hibernate.Interceptor i)
           
 
Method Summary
 void cancelChanges(Proposal p)
           
 void delete(Proposal proposal)
          Silently ignores being passed null and transient objects.
 void deleteById(long id)
           
 Proposal findByCode(String proposalId)
           
 Proposal findById(long id)
           
 List<Proposal> findByUserId(long uid)
           
 List<Proposal> findProposals(Long userId, ProposalStatus status)
           
 List<Proposal> findProposals(ProposalStatus status)
           
 List<Proposal> getAllProposals()
           
 void save(Proposal proposal)
           
 
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

HibernateProposalDao

public HibernateProposalDao()
empty no-arg constructor

See Also:
HibernateDao

HibernateProposalDao

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

findById

public Proposal findById(long id)
                  throws RepositoryException
Returns:
null if a Proposal with the provided id doesn't exist.
Throws:
RepositoryException

findByCode

public Proposal findByCode(String proposalId)
                    throws RepositoryException
Returns:
null if a Proposal with the provided id doesn't exist.
Throws:
RepositoryException

findByUserId

public List<Proposal> findByUserId(long uid)
                            throws RepositoryException
Returns:
a List (possibly empty) of Proposals that uid is an editor of. This method does not return null.
Throws:
RepositoryException

findProposals

public List<Proposal> findProposals(Long userId,
                                    ProposalStatus status)
                             throws RepositoryException
Throws:
RepositoryException

findProposals

public List<Proposal> findProposals(ProposalStatus status)
                             throws RepositoryException
Throws:
RepositoryException

getAllProposals

public List<Proposal> getAllProposals()
                               throws RepositoryException
Throws:
RepositoryException

save

public void save(Proposal proposal)
          throws RepositoryException
Throws:
RepositoryException

deleteById

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

delete

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

Throws:
RepositoryException

cancelChanges

public void cancelChanges(Proposal p)
                   throws RepositoryException
Throws:
RepositoryException


Copyright © 2009. All Rights Reserved.