Methods Summary |
---|
public static org.dasein.gb.Comment | create(java.util.HashMap data)
Sequencer seq = Sequencer.getInstance(Comment.COMMENT_ID);
Comment cmt;
Long id;
id = new Long(seq.next());
data.put(Comment.COMMENT_ID, id);
CommentDAO.create(data);
cmt = new Comment(id, data);
synchronized( cache ) {
cache.cache(id, cmt);
}
return cmt;
|
public static java.util.ArrayList | getApproved()
Iterator results = CommentDAO.getApproved().iterator();
ArrayList cmts = new ArrayList();
while( results.hasNext() ) {
Long id = (Long)results.next();
cmts.add(Comment.getComment(id.longValue()));
}
return cmts;
|
public static org.dasein.gb.Comment | getComment(long cid)
Long id = new Long(cid);
synchronized( cache ) {
Comment cmt = (Comment)cache.get(id);
if( cmt == null ) {
HashMap data = CommentDAO.getComment(cid);
data.put(Comment.COMMENT_ID, id);
cmt = new Comment(id, data);
cache.cache(id, cmt);
}
return cmt;
}
|
public java.lang.String | getComment()
return comment;
|
public long | getCommentID()
return commentID.longValue();
|
public java.util.Date | getCreated()
return created;
|
public java.lang.String | getEmail()
return email;
|
public java.lang.String | getName()
return name;
|
public static java.util.ArrayList | getPending()
Iterator results = CommentDAO.getPending().iterator();
ArrayList cmts = new ArrayList();
while( results.hasNext() ) {
Long id = (Long)results.next();
cmts.add(Comment.getComment(id.longValue()));
}
return cmts;
|
public boolean | isApproved()
return approved.booleanValue();
|
private void | load(java.util.HashMap data)
approved = (Boolean)data.get(Comment.APPROVED);
comment = (String)data.get(Comment.COMMENT);
commentID = (Long)data.get(Comment.COMMENT_ID);
created = (Date)data.get(Comment.CREATED);
email = (String)data.get(Comment.EMAIL);
name = (String)data.get(Comment.NAME);
|
public void | remove()
HashMap data = new HashMap();
data.put(Comment.COMMENT_ID, commentID);
CommentDAO.remove(data);
synchronized( cache ) {
cache.release(commentID);
}
|
public void | save(java.util.HashMap data)
CommentDAO.save(data);
load(data);
|