java.lang.Object
edu.internet2.middleware.grouper.hibernate.ByObject

public class ByObject extends Object
Version:
$Id: ByObject.java,v 1.13 2009-09-15 06:08:44 mchyzer Exp $
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    copyFieldsTo(edu.internet2.middleware.grouper.hibernate.ByQueryBase byQueryBase)
    copy fields from this to the argument
    void
    delete(Object object)
    call hibernate method "delete" on a list of objects HibernateSession.byObjectStatic().delete(Rosetta.getDAO(_f));
    void
    delete(Collection<?> collection)
    call hibernate method "delete" on a list of objects HibernateSession.byObjectStatic().delete(collection);
    void
    deleteBatch(Collection<?> collection)
    call hibernate method "delete" on a list of objects HibernateSession.byObjectStatic().deleteBatch(Rosetta.getDAO(_f));
     
    boolean
    if we should ignore hooks
    <T> T
    load(Class<T> theClass, Serializable id)
    call hibernate method "load" on an object
    static void
    main(String[] args)
     
    save(Object object)
    call hibernate method "save" on an object HibernateSession.byObjectStatic().save(dao);
    void
    save(Collection<?> collection)
    call hibernate method "save" on a list of objects HibernateSession.byObjectStatic().save(collection);
    void
    saveBatch(Collection<?> collection)
    call hibernate method "save" on a collection of objects in batch
    void
    call hibernate method "save" on an object HibernateSession.byObjectStatic().save(dao);
    void
    saveOrUpdate(Collection<?> collection)
    call hibernate method "saveOrUpdate" on a list of objects HibernateSession.byObjectStatic().saveOrUpdate(collection);
    protected edu.internet2.middleware.grouper.hibernate.ByQueryBase
    set(HibernateSession theHibernateSession2)
    set the hibernate session to re-use, or null for a new one byCriteriaStatic().set(hibernateSession2).select(...)
    setEntityName(String theEntityName)
    entity name if the object is mapped to more than one table
    setIgnoreHooks(boolean theIgnoreHooks)
    if we should ignore hooks
    void
    update(Object object)
    call hibernate "update" method on an object
    void
    update(Collection<?> collection)
    call hibernate method "update" on a list of objects HibernateSession.byObjectStatic().update(collection);
    void
    updateBatch(Collection<?> collection)
    call hibernate method "update" on a collection of objects in batch

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • delete

      public void delete(Collection<?> collection) throws GrouperDAOException
       call hibernate method "delete" on a list of objects
       
       HibernateSession.byObjectStatic().delete(collection);
       
       
      Parameters:
      collection - is collection of objects to delete in one transaction. If null or empty just ignore
      Throws:
      GrouperDAOException
    • delete

      public void delete(Object object) throws GrouperDAOException
       call hibernate method "delete" on a list of objects
       
       HibernateSession.byObjectStatic().delete(Rosetta.getDAO(_f));
       
       
      Parameters:
      object - is an object (if collection will still work), if null, will probably throw exception
      Throws:
      GrouperDAOException
    • deleteBatch

      public void deleteBatch(Collection<?> collection) throws GrouperDAOException
       call hibernate method "delete" on a list of objects
       
       HibernateSession.byObjectStatic().deleteBatch(Rosetta.getDAO(_f));
       
       
      Parameters:
      collection - is an object (if collection will still work), if null, will probably throw exception
      Throws:
      GrouperDAOException
    • save

      public void save(Collection<?> collection) throws GrouperDAOException
       call hibernate method "save" on a list of objects
       
       HibernateSession.byObjectStatic().save(collection);
       
       
      Parameters:
      collection - is collection of objects to save in one transaction. If null or empty just ignore
      Throws:
      GrouperDAOException
    • save

      public Serializable save(Object object) throws GrouperDAOException
       call hibernate method "save" on an object
       
       HibernateSession.byObjectStatic().save(dao);
       
       
      Parameters:
      object - to save
      Returns:
      the id
      Throws:
      GrouperDAOException
    • saveBatch

      public void saveBatch(Collection<?> collection) throws GrouperDAOException
       call hibernate method "save" on a collection of objects in batch
       
       
      Parameters:
      collection - of objects to save
      Throws:
      GrouperDAOException
    • saveOrUpdate

      public void saveOrUpdate(Collection<?> collection) throws GrouperDAOException
       call hibernate method "saveOrUpdate" on a list of objects
       
       HibernateSession.byObjectStatic().saveOrUpdate(collection);
       
       
      Parameters:
      collection - is collection of objects to saveOrUpdate in one transaction. If null or empty just ignore
      Throws:
      GrouperDAOException
    • saveOrUpdate

      public void saveOrUpdate(Object object) throws GrouperDAOException
       call hibernate method "save" on an object
       
       HibernateSession.byObjectStatic().save(dao);
       
       
      Parameters:
      object - to save
      Throws:
      GrouperDAOException
    • load

      public <T> T load(Class<T> theClass, Serializable id) throws GrouperDAOException
       call hibernate method "load" on an object
       
       
      Type Parameters:
      T -
      Parameters:
      theClass - to load
      id - to find in db
      Returns:
      the result
      Throws:
      GrouperDAOException
    • update

      public void update(Collection<?> collection) throws GrouperDAOException
       call hibernate method "update" on a list of objects
       
       HibernateSession.byObjectStatic().update(collection);
       
       
      Parameters:
      collection - is collection of objects to update in one transaction. If null or empty just ignore
      Throws:
      GrouperDAOException
    • update

      public void update(Object object) throws GrouperDAOException
      call hibernate "update" method on an object
      Parameters:
      object - to update
      Throws:
      GrouperDAOException
    • setIgnoreHooks

      public ByObject setIgnoreHooks(boolean theIgnoreHooks)
      if we should ignore hooks
      Returns:
      if we should ignore hooks
      See Also:
      • ByQueryBase.setIgnoreHooks(boolean)
    • setEntityName

      public ByObject setEntityName(String theEntityName)
      entity name if the object is mapped to more than one table
      Parameters:
      theEntityName - the entity name of the object
      Returns:
      this object for chaining
    • updateBatch

      public void updateBatch(Collection<?> collection) throws GrouperDAOException
       call hibernate method "update" on a collection of objects in batch
       
       
      Parameters:
      collection - of objects to save
      Throws:
      GrouperDAOException
    • isIgnoreHooks

      public boolean isIgnoreHooks()
      if we should ignore hooks
      Returns:
      if we should ignore hooks
    • copyFieldsTo

      protected void copyFieldsTo(edu.internet2.middleware.grouper.hibernate.ByQueryBase byQueryBase)
      copy fields from this to the argument
      Parameters:
      byQueryBase -
    • getHibernateSession

      protected HibernateSession getHibernateSession()
      Returns:
      Returns the hibernateSession.
    • set

      protected edu.internet2.middleware.grouper.hibernate.ByQueryBase set(HibernateSession theHibernateSession2)
      set the hibernate session to re-use, or null for a new one byCriteriaStatic().set(hibernateSession2).select(...)
      Parameters:
      theHibernateSession2 - is the session to reuse
      Returns:
      this for chaining
    • main

      public static void main(String[] args)
      Parameters:
      args -