Category.java~29~
资源名称:shihua.rar [点击查看]
上传用户:zghglow
上传日期:2022-08-09
资源大小:27227k
文件大小:2k
源码类别:
WEB源码(ASP,PHP,...)
开发平台:
JavaScript
- package com.chinacannel.entity;
- import java.io.*;
- import java.util.*;
- import org.apache.commons.lang.builder.*;
- import com.chinacannel.common.*;
- import org.apache.commons.lang.builder.*;
- import org.apache.commons.logging.*;
- public class Category implements Serializable {
- private static Log log = LogFactory.getLog(Category.class);
- private CommonDAO dao = new CommonDAO();
- private Long cat_ID;
- private String cat_Name;
- private String cat_Language;
- private String cat_Key;
- private Long cat_Order;
- private Set infList;
- private Long infCount = new Long(0);
- public boolean equals(Object other) {
- if (!(other instanceof Category))
- return false;
- Category castOther = (Category) other;
- return new EqualsBuilder()
- .append(this.getCat_ID(), castOther.getCat_ID())
- .isEquals();
- }
- public int hashCode() {
- return new HashCodeBuilder()
- .append(getCat_ID())
- .toHashCode();
- }
- public Long getCat_ID() {
- return cat_ID;
- }
- public String getCat_Key() {
- return cat_Key;
- }
- public String getCat_Language() {
- return cat_Language;
- }
- public String getCat_Name() {
- return cat_Name;
- }
- public Long getCat_Order() {
- return cat_Order;
- }
- public Set getInfList() {
- return infList;
- }
- public void setCat_ID(Long cat_ID) {
- this.cat_ID = cat_ID;
- }
- public void setCat_Key(String cat_Key) {
- this.cat_Key = cat_Key;
- }
- public void setCat_Language(String cat_Language) {
- this.cat_Language = cat_Language;
- }
- public void setCat_Name(String cat_Name) {
- this.cat_Name = cat_Name;
- }
- public void setCat_Order(Long cat_Order) {
- this.cat_Order = cat_Order;
- }
- public void setInfList(Set infList) {
- this.infList = infList;
- }
- public Long getInfCount() {
- if (!cat_ID.equals("") && cat_ID != null) {
- try {
- infCount = new Long(dao.getCountBySql(
- "from Information as inf where inf.category.cat_ID=" +
- this.cat_ID));
- } catch (DAOException ex) {
- log.error(ex.getMessage(), ex);
- return new Long(0);
- }
- } else {
- return new Long(0);
- }
- return infCount;
- }
- }