org.bejug.javacareers.jobs.dao
Interface CommentDao

All Known Implementing Classes:
CommentDaoHibernateImpl

public interface CommentDao

Version:
$Revision: 1.5 $ - $Date: 2005/12/20 15:36:46 $
Author:
Stephan Janssen (Last modified by $Author: shally $)

Method Summary
 void deleteComment(org.bejug.javacareers.jobs.model.Comment comment)
          Delete the given comment.
 void deleteComment(java.lang.Integer id)
          Delete the given comment by id.
 int getChildCommentCount(org.bejug.javacareers.jobs.model.Comment comment)
           
 java.util.List getChildComments(java.lang.Integer commentId)
           
 org.bejug.javacareers.jobs.model.Comment getComment(java.lang.Integer id)
          find the given comment by id.
 org.bejug.javacareers.jobs.model.Comment getCommentBySubject(java.lang.Integer offerId, java.lang.String subject)
          get a comment.
 int getCommentCount(org.bejug.javacareers.jobs.model.Item offer)
           
 java.util.List getComments(java.lang.Integer offerId, boolean rootOnly)
          Get all comments related to the offer.
 java.util.List getUserComments(org.bejug.javacareers.jobs.model.User user)
           
 void store(org.bejug.javacareers.jobs.model.Comment comment)
          Add a new comment.
 

Method Detail

store

public void store(org.bejug.javacareers.jobs.model.Comment comment)
           throws org.springframework.dao.DataAccessException
Add a new comment.

Parameters:
comment - the new commment.
Throws:
org.springframework.dao.DataAccessException - thrown when something goes wrong when getting

getComments

public java.util.List getComments(java.lang.Integer offerId,
                                  boolean rootOnly)
                           throws org.springframework.dao.DataAccessException
Get all comments related to the offer.

Parameters:
rootOnly - if true, return only the root comment.
offerId - the id of the offer to get the comment from.
Returns:
a list of comments related to the offer.
Throws:
org.springframework.dao.DataAccessException - thrown when something goes wrong when getting Todo: add offer to parameter list.

getChildComments

public java.util.List getChildComments(java.lang.Integer commentId)
                                throws org.springframework.dao.DataAccessException
Parameters:
commentId - the id of the comment to get the childcomments from.
Returns:
a list of the childcomments
Throws:
org.springframework.dao.DataAccessException - e

deleteComment

public void deleteComment(org.bejug.javacareers.jobs.model.Comment comment)
                   throws org.springframework.dao.DataAccessException
Delete the given comment.

Parameters:
comment - The comment to be removed.
Throws:
org.springframework.dao.DataAccessException - thrown zhen something goes wrong when getting

deleteComment

public void deleteComment(java.lang.Integer id)
                   throws org.springframework.dao.DataAccessException
Delete the given comment by id.

Parameters:
id - The comment id.
Throws:
org.springframework.dao.DataAccessException - thrown zhen something goes wrong when getting

getComment

public org.bejug.javacareers.jobs.model.Comment getComment(java.lang.Integer id)
                                                    throws org.springframework.dao.DataAccessException
find the given comment by id.

Parameters:
id - The commentid.
Returns:
the found comment.
Throws:
org.springframework.dao.DataAccessException - thrown zhen something goes wrong when getting

getCommentBySubject

public org.bejug.javacareers.jobs.model.Comment getCommentBySubject(java.lang.Integer offerId,
                                                                    java.lang.String subject)
get a comment.

Parameters:
offerId - The offer the comment is linked to
subject - The subject of the comment
Returns:
a comment

getUserComments

public java.util.List getUserComments(org.bejug.javacareers.jobs.model.User user)
Parameters:
user - User
Returns:
all comments posted by this user

getChildCommentCount

public int getChildCommentCount(org.bejug.javacareers.jobs.model.Comment comment)
Parameters:
comment - Comment
Returns:
the nr of child comments from this parent comment

getCommentCount

public int getCommentCount(org.bejug.javacareers.jobs.model.Item offer)
Parameters:
offer - Offer
Returns:
commentCount Returns the nr of comments for this Offer.


Copyright © 2005-2006 BeJUG. All Rights Reserved.