Class HibernateAIModelDAO<T extends AIModel<?,?>>

java.lang.Object
com.logicaldoc.core.HibernatePersistentObjectDAO<T>
com.logicaldoc.ai.HibernateAIModelDAO<T>
Type Parameters:
T - Class of the implementation of a AIModel this DAO handles
All Implemented Interfaces:
AIModelDAO<T>, com.logicaldoc.core.PersistentObjectDAO<T>
Direct Known Subclasses:
HibernateClassifierDAO, HibernateNeuralNetworkDAO, HibernateTokensDetectorDAO

public abstract class HibernateAIModelDAO<T extends AIModel<?,?>> extends com.logicaldoc.core.HibernatePersistentObjectDAO<T> implements AIModelDAO<T>
Hibernate abstract implementation of AIModelDAO to be extended by concrete implementation of DAOs that handle AIModels
Since:
9.2
Author:
Marco Meschieri - LogicalDOC
  • Field Summary

    Fields inherited from interface com.logicaldoc.core.PersistentObjectDAO

    ENTITY
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    delete(long id, int code)
     
    boolean
    existsName(String name, long tenantId)
    Checks the existence of a model name
    findAllModels(Long tenantId)
    Find all the models
    findByName(String name, long tenantId)
    Finds the model by it's name
    getModel(long modelId)
    Retrieves the model by the given ID
    AIModel<?,?>
    getModel(String name, long tenantId)
    Retrieves the model by the given name
    void
    store(T entity)
     

    Methods inherited from class com.logicaldoc.core.HibernatePersistentObjectDAO

    bulkUpdate, delete, deleteAll, deleteAll, findAll, findAll, findAllIds, findAllIds, findById, findById, findByObjectQuery, findByQuery, findByQuery, findByWhere, findByWhere, findIdsByWhere, findIdsByWhere, getDatabaseMetadata, getDbms, getSessionFactory, initialize, isMySQL, isOracle, jdbcUpdate, jdbcUpdate, query, query, queryForDouble, queryForDouble, queryForInt, queryForInt, queryForList, queryForList, queryForList, queryForLong, queryForLong, queryForObject, queryForObject, queryForResultSet, queryForString, setSessionFactory

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.logicaldoc.core.PersistentObjectDAO

    bulkUpdate, delete, deleteAll, deleteAll, findAll, findAll, findAllIds, findAllIds, findById, findById, findByObjectQuery, findByQuery, findByQuery, findByWhere, findByWhere, findIdsByWhere, findIdsByWhere, getDatabaseMetadata, getDbms, initialize, isMySQL, isOracle, jdbcUpdate, jdbcUpdate, query, query, queryForDouble, queryForDouble, queryForInt, queryForInt, queryForList, queryForList, queryForList, queryForLong, queryForLong, queryForObject, queryForObject, queryForResultSet, queryForString
  • Method Details

    • store

      public void store(T entity) throws com.logicaldoc.core.PersistenceException
      Specified by:
      store in interface com.logicaldoc.core.PersistentObjectDAO<T extends AIModel<?,?>>
      Overrides:
      store in class com.logicaldoc.core.HibernatePersistentObjectDAO<T extends AIModel<?,?>>
      Throws:
      com.logicaldoc.core.PersistenceException
    • existsName

      public boolean existsName(String name, long tenantId) throws com.logicaldoc.core.PersistenceException
      Description copied from interface: AIModelDAO
      Checks the existence of a model name
      Specified by:
      existsName in interface AIModelDAO<T extends AIModel<?,?>>
      Parameters:
      name - The name
      tenantId - Identifier of the tenant
      Returns:
      true if the name exists
      Throws:
      com.logicaldoc.core.PersistenceException - Error in the database
    • getModel

      public AIModel getModel(long modelId) throws com.logicaldoc.core.PersistenceException
      Description copied from interface: AIModelDAO
      Retrieves the model by the given ID
      Specified by:
      getModel in interface AIModelDAO<T extends AIModel<?,?>>
      Parameters:
      modelId - identifier of the model
      Returns:
      the model
      Throws:
      com.logicaldoc.core.PersistenceException - Error in the database
    • getModel

      public AIModel<?,?> getModel(String name, long tenantId) throws com.logicaldoc.core.PersistenceException
      Description copied from interface: AIModelDAO
      Retrieves the model by the given name
      Specified by:
      getModel in interface AIModelDAO<T extends AIModel<?,?>>
      Parameters:
      name - name of the model
      tenantId - identifier of the tenant
      Returns:
      the model
      Throws:
      com.logicaldoc.core.PersistenceException - Error in the database
    • findByName

      public T findByName(String name, long tenantId) throws com.logicaldoc.core.PersistenceException
      Description copied from interface: AIModelDAO
      Finds the model by it's name
      Specified by:
      findByName in interface AIModelDAO<T extends AIModel<?,?>>
      Parameters:
      name - The name
      tenantId - Identifier of the tenant
      Returns:
      The found model
      Throws:
      com.logicaldoc.core.PersistenceException - Error in the database
    • findAllModels

      public List<AIModel> findAllModels(Long tenantId) throws com.logicaldoc.core.PersistenceException
      Description copied from interface: AIModelDAO
      Find all the models
      Specified by:
      findAllModels in interface AIModelDAO<T extends AIModel<?,?>>
      Parameters:
      tenantId - optional identifier of the tenant to restrict the search to
      Returns:
      List of models ordered by name
      Throws:
      com.logicaldoc.core.PersistenceException - Error in the database
    • delete

      public void delete(long id, int code) throws com.logicaldoc.core.PersistenceException
      Specified by:
      delete in interface com.logicaldoc.core.PersistentObjectDAO<T extends AIModel<?,?>>
      Overrides:
      delete in class com.logicaldoc.core.HibernatePersistentObjectDAO<T extends AIModel<?,?>>
      Throws:
      com.logicaldoc.core.PersistenceException