edu.internet2.middleware.grouper.internal.dao.hib3
Class Hib3StemSetDAO

java.lang.Object
  extended by edu.internet2.middleware.grouper.internal.dao.hib3.Hib3DAO
      extended by edu.internet2.middleware.grouper.internal.dao.hib3.Hib3StemSetDAO
All Implemented Interfaces:
GrouperDAO, StemSetDAO

public class Hib3StemSetDAO
extends Hib3DAO
implements StemSetDAO

Data Access Object for stem set

Version:
$Id$
Author:
shilen

Field Summary
 
Fields inherited from class edu.internet2.middleware.grouper.internal.dao.hib3.Hib3DAO
hibernateInitted
 
Constructor Summary
Hib3StemSetDAO()
           
 
Method Summary
 void delete(StemSet stemSet)
          delete a stemSet
 void deleteByIfHasStemId(String id)
          delete all stem sets with the given if has stem id
 Set<StemSet> findAllChildren(Collection<StemSet> stemSets, QueryOptions queryOptions)
           
 StemSet findById(String id, boolean exceptionIfNotFound)
           
 Set<StemSet> findByIfHasStemId(String id)
          find by if has stem id
 Set<StemSet> findByIfHasStemIds(Collection ids)
          find by if has stem ids
 Set<StemSet> findByIfHasStemOfStemChildrenAndMinDepth(String stemId, int minDepth, QueryOptions queryOptions)
           
 StemSet findByIfThenImmediate(String stemIdIf, String stemIdThen, boolean exceptionIfNotFound)
          find by if and then (not same) with depth of 1 (immediate)
 Set<StemSet> findByThenHasStemId(String id)
          find by then has stem id
 Set<Object[]> findMissingSelfStemSets()
           
 Set<StemSet> findNonSelfByIfHasStemId(String id)
          find by if has stem id (exclude self stem)
 void saveBatch(Collection<StemSet> stemSets)
          insert in batch
 void saveOrUpdate(StemSet stemSet)
          insert or update a stemSet
 
Methods inherited from class edu.internet2.middleware.grouper.internal.dao.hib3.Hib3DAO
evict, evictEntity, evictQueries, getConfiguration, getSessionFactory, initHibernateIfNotInitted, resourceNameFromClassName, session
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Hib3StemSetDAO

public Hib3StemSetDAO()
Method Detail

findById

public StemSet findById(String id,
                        boolean exceptionIfNotFound)
                 throws StemSetNotFoundException
Specified by:
findById in interface StemSetDAO
Returns:
the stem set
Throws:
StemSetNotFoundException
See Also:
StemSetDAO.findById(java.lang.String, boolean)

saveOrUpdate

public void saveOrUpdate(StemSet stemSet)
Description copied from interface: StemSetDAO
insert or update a stemSet

Specified by:
saveOrUpdate in interface StemSetDAO
See Also:
StemSetDAO.saveOrUpdate(edu.internet2.middleware.grouper.stem.StemSet)

saveBatch

public void saveBatch(Collection<StemSet> stemSets)
Description copied from interface: StemSetDAO
insert in batch

Specified by:
saveBatch in interface StemSetDAO
See Also:
StemSetDAO.saveBatch(java.util.Collection)

findByIfHasStemId

public Set<StemSet> findByIfHasStemId(String id)
Description copied from interface: StemSetDAO
find by if has stem id

Specified by:
findByIfHasStemId in interface StemSetDAO
Returns:
the stem sets
See Also:
StemSetDAO.findByIfHasStemId(java.lang.String)

findByIfHasStemIds

public Set<StemSet> findByIfHasStemIds(Collection ids)
Description copied from interface: StemSetDAO
find by if has stem ids

Specified by:
findByIfHasStemIds in interface StemSetDAO
Returns:
the stem sets
See Also:
StemSetDAO.findByIfHasStemIds(java.util.Collection)

findByThenHasStemId

public Set<StemSet> findByThenHasStemId(String id)
Description copied from interface: StemSetDAO
find by then has stem id

Specified by:
findByThenHasStemId in interface StemSetDAO
Returns:
the stem sets
See Also:
StemSetDAO.findByThenHasStemId(java.lang.String)

findNonSelfByIfHasStemId

public Set<StemSet> findNonSelfByIfHasStemId(String id)
Description copied from interface: StemSetDAO
find by if has stem id (exclude self stem)

Specified by:
findNonSelfByIfHasStemId in interface StemSetDAO
Returns:
the stem sets
See Also:
StemSetDAO.findNonSelfByIfHasStemId(java.lang.String)

delete

public void delete(StemSet stemSet)
Description copied from interface: StemSetDAO
delete a stemSet

Specified by:
delete in interface StemSetDAO
See Also:
StemSetDAO.delete(edu.internet2.middleware.grouper.stem.StemSet)

findByIfThenImmediate

public StemSet findByIfThenImmediate(String stemIdIf,
                                     String stemIdThen,
                                     boolean exceptionIfNotFound)
                              throws StemSetNotFoundException
Description copied from interface: StemSetDAO
find by if and then (not same) with depth of 1 (immediate)

Specified by:
findByIfThenImmediate in interface StemSetDAO
Returns:
the stemSet
Throws:
StemSetNotFoundException
See Also:
StemSetDAO.findByIfThenImmediate(java.lang.String, java.lang.String, boolean)

findAllChildren

public Set<StemSet> findAllChildren(Collection<StemSet> stemSets,
                                    QueryOptions queryOptions)
Specified by:
findAllChildren in interface StemSetDAO
Returns:
children
See Also:
StemSetDAO.findAllChildren(java.util.Collection, edu.internet2.middleware.grouper.internal.dao.QueryOptions)

findByIfHasStemOfStemChildrenAndMinDepth

public Set<StemSet> findByIfHasStemOfStemChildrenAndMinDepth(String stemId,
                                                             int minDepth,
                                                             QueryOptions queryOptions)
Specified by:
findByIfHasStemOfStemChildrenAndMinDepth in interface StemSetDAO
Returns:
stemSets
See Also:
StemSetDAO.findByIfHasStemOfStemChildrenAndMinDepth(java.lang.String, int, edu.internet2.middleware.grouper.internal.dao.QueryOptions)

deleteByIfHasStemId

public void deleteByIfHasStemId(String id)
Description copied from interface: StemSetDAO
delete all stem sets with the given if has stem id

Specified by:
deleteByIfHasStemId in interface StemSetDAO
See Also:
StemSetDAO.deleteByIfHasStemId(java.lang.String)

findMissingSelfStemSets

public Set<Object[]> findMissingSelfStemSets()
Specified by:
findMissingSelfStemSets in interface StemSetDAO
Returns:
stems that are missing self stem sets. First element of the array is the stemId, second is the parentStemId
See Also:
StemSetDAO.findMissingSelfStemSets()