/** * myJerry | Evenstar * Copyright (C) 2010 myJerry Development Team * http://www.myjerry.org * * The file is licensed under the the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * * See the License for the specific language governing permissions and * limitations under the License. * */ package org.myjerry.evenstar.model; import java.util.Date; import javax.jdo.annotations.IdGeneratorStrategy; import javax.jdo.annotations.IdentityType; import javax.jdo.annotations.PersistenceCapable; import javax.jdo.annotations.Persistent; import javax.jdo.annotations.PrimaryKey; import com.google.appengine.api.datastore.Text; @PersistenceCapable(identityType = IdentityType.APPLICATION, detachable = "true") public class Comment { public static final int PRIVACY_MODE_PUBLIC = 1; public static final int PRIVACY_MODE_PRIVATE = 2; @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) private Long commentID; @Persistent private Long postID; @Persistent private Long blogID; @Persistent private Text content; @Persistent private Long authorID; @Persistent private Date timestamp; @Persistent private Integer permissions; @Persistent private Boolean deleted = false; @Persistent private Long parentID; @Persistent private Date published; /** * @return the commentID */ public Long getCommentID() { return commentID; } /** * @param commentID the commentID to set */ public void setCommentID(Long commentID) { this.commentID = commentID; } /** * @return the postID */ public Long getPostID() { return postID; } /** * @param postID the postID to set */ public void setPostID(Long postID) { this.postID = postID; } /** * @return the blogID */ public Long getBlogID() { return blogID; } /** * @param blogID the blogID to set */ public void setBlogID(Long blogID) { this.blogID = blogID; } /** * @return the content */ public String getContent() { if(this.content != null) { return this.content.getValue(); } return null; } /** * @param content the content to set */ public void setContent(String content) { this.content = new Text(content); } /** * @return the authorID */ public Long getAuthorID() { return authorID; } /** * @param authorID the authorID to set */ public void setAuthorID(Long authorID) { this.authorID = authorID; } /** * @return the timestamp */ public Date getTimestamp() { return timestamp; } /** * @param timestamp the timestamp to set */ public void setTimestamp(Date timestamp) { this.timestamp = timestamp; } /** * @return the permissions */ public Integer getPermissions() { return permissions; } /** * @param permissions the permissions to set */ public void setPermissions(Integer permissions) { this.permissions = permissions; } /** * @return the deleted */ public Boolean getDeleted() { return deleted; } /** * @param deleted the deleted to set */ public void setDeleted(Boolean deleted) { this.deleted = deleted; } /** * @return the parentID */ public Long getParentID() { return parentID; } /** * @param parentID the parentID to set */ public void setParentID(Long parentID) { this.parentID = parentID; } /** * @return the published */ public Date getPublished() { return published; } /** * @param published the published to set */ public void setPublished(Date published) { this.published = published; } }