it.unimi.dico.islab.idbs2.kc.session
Class DocumentManager

java.lang.Object
  extended by it.unimi.dico.islab.idbs2.kc.session.DocumentManager

public class DocumentManager
extends Object

Manages object saving and querying for Document wrapper. This class contains most used interrogations (such as getDocumentChunkById and methods for saving an object of Document class.

IMPORTANT: this class has no public constructor. A singleton instance of this class is contained in KCSessionManager class

Author:
Vegeziel
See Also:
Document

Method Summary
 Document getDocumentById(String docUrl)
          Used to load a Document instance from the database.
protected static DocumentManager getDocumentManager()
           
 void save(Document doc)
          Give persistence to the given Document object using associated Hibernate mappings.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getDocumentManager

protected static DocumentManager getDocumentManager()

getDocumentById

public Document getDocumentById(String docUrl)
Used to load a Document instance from the database. This method uses the internal Session Factory of this package.

Parameters:
docUrl -
Returns:
a wrapper containing all information about the document having docUrl as primary key.

save

public void save(Document doc)

Give persistence to the given Document object using associated Hibernate mappings.

This method executes the saveOrUpdate method of the Hibernate Session. Every Document object is saved in cascade mode by default when saving the owner KnowledgeChunk object: invoking this method directly will save doc object and its parameters; no action will be performed for other connected objects.

See Also:
Document