Class GenericHibernateManualUpdateDao<T,​ID extends java.io.Serializable>

    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected void add​(T bean, ITransaction transaction)
      Adds the bean to the persistence layer.
      protected void addOrUpdate​(T bean, ITransaction transaction)  
      protected boolean delete​(ID id, ITransaction transaction)
      Deletes the bean with the given id from persistence.
      protected void evict​(ID id, ITransaction transaction)
      Evicts the bean with the given id from the second-level cache.
      protected boolean exists​(ID id, ITransaction transaction)
      Returns whether the bean of identifier id exists.
      protected java.util.List<T> findByCriteria​(ITransaction transaction, org.hibernate.criterion.Criterion... criterions)
      Convenience method for subclasses.
      protected java.util.List<T> findByCriteria​(ITransaction transaction, org.hibernate.criterion.Criterion[] criterions, org.hibernate.criterion.Order[] orders)
      Convenience method for subclasses.
      protected T get​(ID id, ITransaction transaction)
      Returns the bean with the given id.
      protected abstract ID getIdentifier​(T bean)  
      protected java.lang.Class<T> getPersistentClass()
      Returns the class whose persistence this DAO controls.
      protected void setReadOnly​(ITransaction transaction, java.util.Collection<T> beans)
      Sets a collection of beans to read-only state.
      protected void update​(T bean, ITransaction transaction)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • GenericHibernateManualUpdateDao

        protected GenericHibernateManualUpdateDao​(java.lang.Class<T> persistentClass)
    • Method Detail

      • getIdentifier

        protected abstract ID getIdentifier​(T bean)
      • getPersistentClass

        protected java.lang.Class<T> getPersistentClass()
        Returns the class whose persistence this DAO controls.
      • add

        protected void add​(T bean,
                           ITransaction transaction)
                    throws PortalException
        Adds the bean to the persistence layer.
        Parameters:
        bean - the bean to be added.
        transaction - the transaction for persistence access.
        Throws:
        PortalException
      • exists

        protected boolean exists​(ID id,
                                 ITransaction transaction)
                          throws PortalException
        Returns whether the bean of identifier id exists.
        Parameters:
        id - the bean identifier.
        transaction - the transacion to be used.
        Returns:
        whether the bean of identifier id exists.
        Throws:
        PortalException
        Since:
        8.0.0
      • delete

        protected boolean delete​(ID id,
                                 ITransaction transaction)
                          throws PortalException
        Deletes the bean with the given id from persistence.
        Parameters:
        id - the bean's id.
        transaction - the transaction for persistence access. Must be a ITransactionHibernate.
        Returns:
        true if the bean was deleted, or false if it did not exist
        Throws:
        PortalException
      • evict

        protected void evict​(ID id,
                             ITransaction transaction)
                      throws PortalException
        Evicts the bean with the given id from the second-level cache.
        Parameters:
        id - the bean identifier.
        transaction - the transaction for persistence access.
        Throws:
        PortalException
        Since:
        4.0.11
      • setReadOnly

        protected void setReadOnly​(ITransaction transaction,
                                   java.util.Collection<T> beans)
                            throws DaoException
        Sets a collection of beans to read-only state.
        Throws:
        DaoException
      • findByCriteria

        protected java.util.List<T> findByCriteria​(ITransaction transaction,
                                                   org.hibernate.criterion.Criterion[] criterions,
                                                   org.hibernate.criterion.Order[] orders)
                                            throws DaoException
        Convenience method for subclasses. All returned entities are returned in read-only state.
        Throws:
        DaoException
      • findByCriteria

        protected java.util.List<T> findByCriteria​(ITransaction transaction,
                                                   org.hibernate.criterion.Criterion... criterions)
                                            throws DaoException
        Convenience method for subclasses. All returned entities are returned in read-only state.
        Throws:
        DaoException