1 24 package org.infoglue.cms.entities.content; 25 26 import org.infoglue.cms.entities.kernel.Persistent; 27 import org.infoglue.cms.entities.management.CategoryVO; 28 import org.infoglue.cms.util.ConstraintExceptionBuffer; 29 import org.infoglue.cms.util.DomainUtils; 30 31 35 public class ContentCategoryVO extends Persistent 36 { 37 private Integer contentCategoryId; 38 private String attributeName; 39 private Integer contentVersionId; 40 private CategoryVO category = new CategoryVO(); 41 42 public ContentCategoryVO() {} 43 44 public ContentCategoryVO(String attributeName, Integer contentVersionId, CategoryVO category) 45 { 46 setAttributeName(attributeName); 47 setContentVersionId(contentVersionId); 48 setCategory(category); 49 } 50 51 public ContentCategoryVO(Integer id, String attributeName, Integer contentVersionId, CategoryVO category) 52 { 53 this(attributeName, contentVersionId, category); 54 setContentCategoryId(id); 55 } 56 57 public Integer getId() 58 { 59 return getContentCategoryId(); 60 } 61 62 public Integer getContentCategoryId() 63 { 64 return contentCategoryId; 65 } 66 67 public void setContentCategoryId(Integer i) 68 { 69 contentCategoryId = i; 70 } 71 72 public String getAttributeName() 73 { 74 return attributeName; 75 } 76 77 public void setAttributeName(String s) 78 { 79 attributeName = s; 80 } 81 82 public Integer getContentVersionId() 83 { 84 return contentVersionId; 85 } 86 87 public void setContentVersionId(Integer i) 88 { 89 contentVersionId = i; 90 } 91 92 public CategoryVO getCategory() 93 { 94 return category; 95 } 96 97 public void setCategory(CategoryVO c) 98 { 99 category = (c != null) ? c : new CategoryVO(); 100 } 101 102 105 public ConstraintExceptionBuffer validate() 106 { 107 return new ConstraintExceptionBuffer(); 108 } 109 110 public boolean equals(Object o) 111 { 112 if (super.equals(o)) 113 { 114 ContentCategoryVO vo = (ContentCategoryVO)o; 115 return DomainUtils.equals(contentCategoryId, vo.contentCategoryId) 116 && DomainUtils.equals(attributeName, vo.attributeName) 117 && DomainUtils.equals(contentVersionId, vo.contentVersionId) 118 && DomainUtils.equals(category.getId(), vo.category.getId()); 119 } 120 return false; 121 } 122 123 public StringBuffer toStringBuffer() 124 { 125 StringBuffer sb = super.toStringBuffer(); 126 sb.append(" attributeName=").append(attributeName) 127 .append(" contentVersionId=").append(contentVersionId) 128 .append(" categoryId=").append(category.getId()); 129 return sb; 130 } 131 132 } 133 134 | Popular Tags |