fr.paris.lutece.plugins.document.business
Class DocumentCommentDAO

java.lang.Object
  extended by fr.paris.lutece.plugins.document.business.DocumentCommentDAO
All Implemented Interfaces:
IDocumentCommentDAO

public final class DocumentCommentDAO
extends java.lang.Object
implements IDocumentCommentDAO

This class provides Data Access methods for DocumentComment objects


Constructor Summary
DocumentCommentDAO()
           
 
Method Summary
 int checkCommentNb(int nDocumentId)
          Return the nb of comment for a document
 void delete(int nCommentId)
          Delete a record from the table
 void insert(DocumentComment documentComment)
          Insert a new record in the table.
 DocumentComment load(int nCommentId)
          Load the data of DocumentComment from the table
 java.util.List<DocumentComment> selectByDocument(int nDocumentId, boolean bPublishedOnly)
          Gets all the comments for an document
 void store(DocumentComment documentComment)
          Update the record in the table
 void updateCommentStatus(int nCommentId, int nStatus)
          Update status from the comment
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DocumentCommentDAO

public DocumentCommentDAO()
Method Detail

insert

public void insert(DocumentComment documentComment)
Insert a new record in the table.

Specified by:
insert in interface IDocumentCommentDAO
Parameters:
documentComment - The DocumentComment object

load

public DocumentComment load(int nCommentId)
Load the data of DocumentComment from the table

Specified by:
load in interface IDocumentCommentDAO
Parameters:
nCommentId - The identifier of DocumentComment
Returns:
the instance of the DocumentComment

delete

public void delete(int nCommentId)
Delete a record from the table

Specified by:
delete in interface IDocumentCommentDAO
Parameters:
nCommentId - the documentComment identifier

store

public void store(DocumentComment documentComment)
Update the record in the table

Specified by:
store in interface IDocumentCommentDAO
Parameters:
documentComment - The reference of DdocumentComment

selectByDocument

public java.util.List<DocumentComment> selectByDocument(int nDocumentId,
                                                        boolean bPublishedOnly)
Gets all the comments for an document

Specified by:
selectByDocument in interface IDocumentCommentDAO
Parameters:
nDocumentId - the identifier of the Document
bPublishedOnly - set to true to return published comments only
Returns:
the list of comments, in chronological order for published comments, in reverse chronological order otherwise

updateCommentStatus

public void updateCommentStatus(int nCommentId,
                                int nStatus)
Update status from the comment

Specified by:
updateCommentStatus in interface IDocumentCommentDAO
Parameters:
nComment - The Comment identifier
nStatus - The published Status

checkCommentNb

public int checkCommentNb(int nDocumentId)
Return the nb of comment for a document

Specified by:
checkCommentNb in interface IDocumentCommentDAO
Parameters:
strIdDocument - the document identifier
Returns:
the nb of document


Copyright © 2008 Mairie de Paris. All Rights Reserved.