org.bejug.javacareers.jobs.dao.hibernate
Class CommentDaoHibernateImpl

java.lang.Object
  extended byorg.springframework.dao.support.DaoSupport
      extended byorg.springframework.orm.hibernate3.support.HibernateDaoSupport
          extended byorg.bejug.javacareers.jobs.dao.hibernate.CommentDaoHibernateImpl
All Implemented Interfaces:
CommentDao, org.springframework.beans.factory.InitializingBean

public class CommentDaoHibernateImpl
extends org.springframework.orm.hibernate3.support.HibernateDaoSupport
implements CommentDao

Comment Hibernate DAO implementation.

Version:
$Revision: 1.5 $ - $Date: 2005/12/09 10:46:55 $
Author:
Stephan Janssen (Last modified by $Author: shally $)

Field Summary
 
Fields inherited from class org.springframework.dao.support.DaoSupport
logger
 
Constructor Summary
CommentDaoHibernateImpl()
           
 
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.
 
Methods inherited from class org.springframework.orm.hibernate3.support.HibernateDaoSupport
checkDaoConfig, closeSessionIfNecessary, convertHibernateAccessException, createHibernateTemplate, getHibernateTemplate, getSession, getSession, getSessionFactory, releaseSession, setHibernateTemplate, setSessionFactory
 
Methods inherited from class org.springframework.dao.support.DaoSupport
afterPropertiesSet, initDao
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommentDaoHibernateImpl

public CommentDaoHibernateImpl()
Method Detail

getCommentBySubject

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

Specified by:
getCommentBySubject in interface CommentDao
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)

Specified by:
getUserComments in interface CommentDao
Parameters:
user - User
Returns:
all comments posted by this user

getChildCommentCount

public int getChildCommentCount(org.bejug.javacareers.jobs.model.Comment comment)

Specified by:
getChildCommentCount in interface CommentDao
Parameters:
comment - Comment
Returns:
the nr of child comments from this parent comment

getCommentCount

public int getCommentCount(org.bejug.javacareers.jobs.model.Item offer)

Specified by:
getCommentCount in interface CommentDao
Parameters:
offer - Offer
Returns:
commentCount Returns the nr of comments for this Offer.

store

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

Specified by:
store in interface CommentDao
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.

Specified by:
getComments in interface CommentDao
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

Specified by:
getChildComments in interface CommentDao
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.

Specified by:
deleteComment in interface CommentDao
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.

Specified by:
deleteComment in interface CommentDao
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.

Specified by:
getComment in interface CommentDao
Parameters:
id - The commentid.
Returns:
the found comment.
Throws:
org.springframework.dao.DataAccessException - thrown zhen something goes wrong when getting


Copyright © 2005-2006 BeJUG. All Rights Reserved.