Class DocumentDAO

java.lang.Object
ru.bgcrm.dao.CommonDAO
ru.bgcrm.plugin.document.dao.DocumentDAO

public class DocumentDAO extends CommonDAO
  • Constructor Details Link icon

    • DocumentDAO Link icon

      public DocumentDAO(Connection con)
  • Method Details Link icon

    • add Link icon

      public void add(String objectType, int objectId, byte[] data, String title)
      Добавляет привязанный к объекту документ.
      Parameters:
      objectType -
      objectId -
      data -
      title -
    • add Link icon

      public void add(Document b) throws SQLException
      Добавляет документ. Файл должен быть загружен ранее с помощью FileDataDAO.
      Parameters:
      b -
      Throws:
      SQLException
    • delete Link icon

      public void delete(Document doc) throws Exception
      Удаляет документ и привязанный к нему файл.
      Parameters:
      doc -
      Throws:
      Exception
    • getDocumentById Link icon

      public Document getDocumentById(int id)
      Возвращает документ по его ID.
      Parameters:
      id -
      Returns:
    • searchObjectDocuments Link icon

      public void searchObjectDocuments(Pageable<Document> result, String objectType, int objectId)
      Ищет документы привязанные к объекту.
      Parameters:
      result -
      objectType -
      objectId -
    • createDocumentFile Link icon

      public OutputStream createDocumentFile(Document doc, String title) throws Exception
      Throws:
      Exception
    • getFromRS Link icon

      public static Document getFromRS(ResultSet rs, String prefix) throws SQLException
      Throws:
      SQLException