public class HibernateDocumentDAO extends HibernatePersistentObjectDAO<Document> implements DocumentDAO
DocumentDAOentityClass, log, sessionFactory| Modifier and Type | Method and Description |
|---|---|
void |
cleanExpiredTransactions()
Cleans all references to expired transactions.
|
long |
count(boolean computeDeleted)
Counts the number of documents
|
long |
countByIndexed(int indexed)
Counts the number of documents indexed or not
|
boolean |
delete(long docId,
History transaction)
This method deletes the document object and insert a new document history
entry.
|
void |
deleteAll(Collection<Document> documents,
History transaction)
Deletes all documents form the database and modifies the custom ids of
all documents
|
boolean |
deleteOrphaned(long deleteUserId)
This method deletes the documents into deleted folders.
|
List<String> |
findAllTags(String firstLetter)
Searches for all tags,
|
Document |
findByCustomId(String customId)
This method finds a document by the custom ID.
|
List<Document> |
findByFileNameAndParentFolderId(Long folderId,
String fileName,
Long excludeId,
Integer max)
Finds that document that lies under a specific folder (given by the id)
an with a given fileName(like operator is used)
|
List<Document> |
findByFolder(long folderId,
Integer max)
Finds all documents inside the given folder.
|
List<Document> |
findByIds(Long[] ids,
Integer max)
Finds all documents whose id is included in the given pool of ids
|
List<Document> |
findByIndexed(int indexed)
Finds all documents by the indexed state.
|
List<Document> |
findByLockUserAndStatus(Long userId,
Integer status)
Finds all document of the specified status and locked by the specified
user
|
List<Document> |
findByTitleAndParentFolderId(long folderId,
String title,
Long excludeId)
Finds that document that lies under a specific folder (given by the id)
an with a given title(like operator is used)
|
List<Long> |
findByUserId(long userId)
Finds all documents for an user.
|
List<Document> |
findByUserIdAndTag(long userId,
String tag,
Integer max)
Finds authorized documents for a user having a specified tag.
|
List<Document> |
findDeleted(long userId,
Integer maxHits)
Finds all deleted docs of a specific user.
|
List<Long> |
findDeletedDocIds()
Gets the collection of deleted document ids
|
List<Document> |
findDeletedDocs()
Finds the list of deleted documents.
|
List<Long> |
findDocIdByFolder(long folderId,
Integer max)
Finds all document ids inside the given folder.
|
List<Long> |
findDocIdByTag(String tag)
This method finds all Doc Ids by a tag.
|
List<Long> |
findDocIdByUserIdAndTag(long userId,
String tag)
Finds authorized documents ids for a user having a specified tag.
|
List<Document> |
findLastDownloadsByUserId(long userId,
int maxResults)
Finds the last downloaded documents by the given user
|
List<Document> |
findLastModifiedByUserId(long userId,
int maxElements)
Finds a max number of documents last modified by an user.
|
List<Document> |
findLinkedDocuments(long docId,
String linkType,
Integer direction)
This method enlists documents linked to the given document.
|
List<Document> |
findLockedByUserId(long userId)
Deprecated.
|
Collection<Long> |
findPublishedIds(Collection<Long> folderIds)
Finds all document ids inside the specified folders that are published in
the current date.
|
List<Long> |
findShortcutIds(long docId)
Gets the ids of all shortcuts associated to the document with the given
docId
|
Map<String,Integer> |
findTags(String firstLetter)
This method selects all tags and counts the occurrences.
|
long |
getTotalSize(boolean computeDeleted)
Obtains the total size of the archive, that is the sum of sizes of all
documents
|
void |
initialize(Document doc)
Doesn't do anything by default
|
void |
makeImmutable(long docId,
History transaction)
Marks the document, with the given docId, as immutable.
|
void |
restore(long docId,
long folderId,
History transaction)
Restores a previously deleted document
|
void |
setConfig(ContextProperties config) |
void |
setFolderDAO(FolderDAO folderDAO) |
void |
setHistoryDAO(HistoryDAO historyDAO) |
void |
setLinkDAO(DocumentLinkDAO linkDAO) |
void |
setListenerManager(DocumentListenerManager listenerManager) |
void |
setNoteDAO(DocumentNoteDAO noteDAO) |
void |
setStorer(Storer storer) |
void |
setUserDAO(UserDAO userDAO) |
void |
setUserDocDAO(UserDocDAO userDocDAO) |
void |
setVersionDAO(VersionDAO versionDAO) |
boolean |
store(Document doc)
This method persists the entity object.
|
boolean |
store(Document doc,
History transaction)
This method persists the document object and insert a new document
history entry.
|
void |
updateDigest(Document doc)
Updates the document's digest (SHA-1)
|
bulkUpdate, delete, deleteAll, evict, findAll, findAllIds, findById, findByQuery, findByWhere, findByWhere, findIdsByWhere, findIdsByWhere, flush, getConnection, getCurrentSession, getDbms, getSessionFactory, isHsql, isMySQL, isOracle, isSqlServer, jdbcUpdate, jdbcUpdate, merge, prepareQuery, query, queryForInt, queryForList, queryForList, queryForLong, queryForRowSet, refresh, saveOrUpdate, setSessionFactoryclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitbulkUpdate, delete, deleteAll, findAll, findAllIds, findById, findByQuery, findByWhere, findByWhere, findIdsByWhere, findIdsByWhere, getDbms, jdbcUpdate, jdbcUpdate, query, queryForInt, queryForList, queryForList, queryForLong, queryForRowSetpublic void setListenerManager(DocumentListenerManager listenerManager)
public void setUserDocDAO(UserDocDAO userDocDAO)
public void setVersionDAO(VersionDAO versionDAO)
public void setLinkDAO(DocumentLinkDAO linkDAO)
public void setUserDAO(UserDAO userDAO)
public void setHistoryDAO(HistoryDAO historyDAO)
public boolean delete(long docId,
History transaction)
DocumentDAOdelete in interface DocumentDAOdocId - The id of the document to deletetransaction - entry to log the eventpublic List<Long> findByUserId(long userId)
DocumentDAOfindByUserId in interface DocumentDAOuserId - ID of the user.@Deprecated public List<Document> findLockedByUserId(long userId)
DocumentDAOfindLockedByUserId in interface DocumentDAOuserId - Id of the user.com.logicaldoc.core.document.dao.DocumentDAO#findLockedByUserId(java.lang.String)public List<Document> findByLockUserAndStatus(Long userId, Integer status)
DocumentDAOfindByLockUserAndStatus in interface DocumentDAOuserId - The user id(optional)status - The status code(optional)public List<Long> findDocIdByTag(String tag)
DocumentDAOfindDocIdByTag in interface DocumentDAOtag - Tag of the document.public boolean store(Document doc)
PersistentObjectDAOstore in interface PersistentObjectDAO<Document>store in class HibernatePersistentObjectDAO<Document>doc - entity to be stored.public boolean store(Document doc, History transaction)
DocumentDAOstore in interface DocumentDAOtransaction - entry to log the eventpublic void updateDigest(Document doc)
DocumentDAOupdateDigest in interface DocumentDAOdoc - The document to be processedpublic List<Document> findLastModifiedByUserId(long userId, int maxElements)
DocumentDAOfindLastModifiedByUserId in interface DocumentDAOuserId - ID of the user.public Map<String,Integer> findTags(String firstLetter)
DocumentDAOfindTags in interface DocumentDAOpublic List<String> findAllTags(String firstLetter)
DocumentDAOfindAllTags in interface DocumentDAOfirstLetter - Optional first letter hintpublic List<Document> findByUserIdAndTag(long userId, String tag, Integer max)
DocumentDAOfindByUserIdAndTag in interface DocumentDAOuserId - ID of the usertag - Tag of the documentmax - Optional, defines the maximum records numberpublic List<Long> findDocIdByUserIdAndTag(long userId, String tag)
DocumentDAOfindDocIdByUserIdAndTag in interface DocumentDAOuserId - ID of the user.tag - Tag of the documentpublic List<Document> findLastDownloadsByUserId(long userId, int maxResults)
DocumentDAOfindLastDownloadsByUserId in interface DocumentDAOuserId - id of the usermaxResults - maximum number of returned elementspublic List<Long> findDocIdByFolder(long folderId, Integer max)
DocumentDAOfindDocIdByFolder in interface DocumentDAOfolderId - Folder identifierpublic List<Document> findByFolder(long folderId, Integer max)
DocumentDAOfindByFolder in interface DocumentDAOfolderId - Folder identifierpublic List<Document> findLinkedDocuments(long docId, String linkType, Integer direction)
DocumentDAO
Important: The attribute direction defines the search
logic as follows:
findLinkedDocuments in interface DocumentDAOdocId - All documents linked to this one will be searchedlinkType - Type of the link (optional)direction - if 1 docId will be compared to link's document1, id 2
docId will be compared to link's document2, if null docId will be
compared to both document1 and document2 of the link.public List<Document> findByFileNameAndParentFolderId(Long folderId, String fileName, Long excludeId, Integer max)
DocumentDAOfindByFileNameAndParentFolderId in interface DocumentDAOfolderId - The folder id (it can be null).excludeId - Optional id of a document that must not be consideredmax - Optional maximum number of returned elementspublic List<Document> findByTitleAndParentFolderId(long folderId, String title, Long excludeId)
DocumentDAOfindByTitleAndParentFolderId in interface DocumentDAOfolderId - The folder id (it can be null).excludeId - Optional id of a document that must not be consideredpublic void initialize(Document doc)
HibernatePersistentObjectDAOinitialize in interface DocumentDAOinitialize in interface PersistentObjectDAO<Document>initialize in class HibernatePersistentObjectDAO<Document>doc - The entity to be initialisedpublic List<Long> findDeletedDocIds()
DocumentDAOfindDeletedDocIds in interface DocumentDAOpublic List<Document> findDeletedDocs()
DocumentDAOAttention: The returned objects are not fully operative and are populated with a minimal set of data.
findDeletedDocs in interface DocumentDAOpublic long getTotalSize(boolean computeDeleted)
DocumentDAOgetTotalSize in interface DocumentDAOcomputeDeleted - If true, even deleted documents are consideredpublic long count(boolean computeDeleted)
DocumentDAOcount in interface DocumentDAOcomputeDeleted - If true, even deleted documents are consideredpublic List<Document> findByIndexed(int indexed)
DocumentDAOfindByIndexed in interface DocumentDAOindexed - the indexed propertypublic void restore(long docId,
long folderId,
History transaction)
DocumentDAOrestore in interface DocumentDAOdocId - Id of the document to be restoredfolderId - Id of the folder the document will be restored intotransaction - entry to log the eventpublic Document findByCustomId(String customId)
DocumentDAOfindByCustomId in interface DocumentDAOcustomId - custom ID of the document.public void makeImmutable(long docId,
History transaction)
DocumentDAOmakeImmutable in interface DocumentDAOtransaction - entry to log the eventpublic void deleteAll(Collection<Document> documents, History transaction)
DocumentDAOdeleteAll in interface DocumentDAOdocuments - The documents to be deletedtransaction - entry to log the eventpublic void setNoteDAO(DocumentNoteDAO noteDAO)
public void setStorer(Storer storer)
public long countByIndexed(int indexed)
DocumentDAOcountByIndexed in interface DocumentDAOpublic List<Long> findShortcutIds(long docId)
DocumentDAOfindShortcutIds in interface DocumentDAOdocId - The document Idpublic List<Document> findDeleted(long userId, Integer maxHits)
DocumentDAOfindDeleted in interface DocumentDAOuserId - The user that performed the deletionmaxHits - Optional defines the max number of returned hitspublic void setConfig(ContextProperties config)
public void setFolderDAO(FolderDAO folderDAO)
public List<Document> findByIds(Long[] ids, Integer max)
DocumentDAOfindByIds in interface DocumentDAOpublic boolean deleteOrphaned(long deleteUserId)
DocumentDAOdeleteOrphaned in interface DocumentDAOdeleteUserId - The id of the user that performs the deleting.public Collection<Long> findPublishedIds(Collection<Long> folderIds)
DocumentDAOfindPublishedIds in interface DocumentDAOfolderIds - Set of folder ids in which the method will searchpublic void cleanExpiredTransactions()
DocumentDAOcleanExpiredTransactions in interface DocumentDAOCopyright © 2008-2014 Logical Objects. All Rights Reserved.