📄 smoney.java
字号:
/*
* Smoney.java
*实体bean
* Created on 2007年12月9日, 上午12:43
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package com.classmoney.entity;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
/**
* 实体类 Smoney
*
* @author Administrator
*/
@Entity
@Table(name = "smoney")
@NamedQueries( {
@NamedQuery(name = "Smoney.findById", query = "SELECT s FROM Smoney s WHERE s.id = :id"),
@NamedQuery(name = "Smoney.findByCmoney", query = "SELECT s FROM Smoney s WHERE s.cmoney = :cmoney"),
@NamedQuery(name = "Smoney.findByCtime", query = "SELECT s FROM Smoney s WHERE s.ctime = :ctime"),
@NamedQuery(name = "Smoney.findByStudent", query = "SELECT s FROM Smoney s WHERE s.student = :student"),
@NamedQuery(name = "Smoney.findByMoneytype", query = "SELECT s FROM Smoney s WHERE s.moneytype = :moneytype"),
@NamedQuery(name = "Smoney.findByContent", query = "SELECT s FROM Smoney s WHERE s.content = :content")
})
public class Smoney implements Serializable {
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
@Column(name = "id", nullable = false)
private Short id;
@Column(name = "cmoney", nullable = false)
private double cmoney;
@Column(name = "ctime", nullable = false)
@Temporal(TemporalType.TIMESTAMP)
private Date ctime;
@Column(name = "student", nullable = false)
private String student;
@Column(name = "moneytype", nullable = false)
private short moneytype;
@Column(name = "content")
private String content;
/** Creates a new instance of Smoney */
public Smoney() {
}
/**
* 使用指定的值创建 Smoney 的新实例。
* @param id,Smoney 的 id
*/
public Smoney(Short id) {
this.id = id;
}
/**
* 使用指定的值创建 Smoney 的新实例。
* @param id,Smoney 的 id
* @param cmoney,Smoney 的 cmoney
* @param ctime,Smoney 的 ctime
* @param student,Smoney 的 student
* @param moneytype,Smoney 的 moneytype
*/
public Smoney(Short id, double cmoney, Date ctime, String student, short moneytype) {
this.id = id;
this.cmoney = cmoney;
this.ctime = ctime;
this.student = student;
this.moneytype = moneytype;
}
/**
* 获取此 Smoney 的 id。
* @return id
*/
public Short getId() {
return this.id;
}
/**
* 将此 Smoney 的 id 设置为指定的值。
* @param id,新建 id
*/
public void setId(Short id) {
this.id = id;
}
/**
* 获取此 Smoney 的 cmoney。
* @return cmoney
*/
public double getCmoney() {
return this.cmoney;
}
/**
* 将此 Smoney 的 cmoney 设置为指定的值。
* @param cmoney,新建 cmoney
*/
public void setCmoney(double cmoney) {
this.cmoney = cmoney;
}
/**
* 获取此 Smoney 的 ctime。
* @return ctime
*/
public Date getCtime() {
return this.ctime;
}
/**
* 将此 Smoney 的 ctime 设置为指定的值。
* @param ctime,新建 ctime
*/
public void setCtime(Date ctime) {
this.ctime = ctime;
}
/**
* 获取此 Smoney 的 student。
* @return student
*/
public String getStudent() {
return this.student;
}
/**
* 将此 Smoney 的 student 设置为指定的值。
* @param student,新建 student
*/
public void setStudent(String student) {
this.student = student;
}
/**
* 获取此 Smoney 的 moneytype。
* @return moneytype
*/
public short getMoneytype() {
return this.moneytype;
}
/**
* 将此 Smoney 的 moneytype 设置为指定的值。
* @param moneytype,新建 moneytype
*/
public void setMoneytype(short moneytype) {
this.moneytype = moneytype;
}
/**
* 获取此 Smoney 的 content。
* @return content
*/
public String getContent() {
return this.content;
}
/**
* 将此 Smoney 的 content 设置为指定的值。
* @param content,新建 content
*/
public void setContent(String content) {
this.content = content;
}
/**
* 返回对象的散列代码值。该实现根据此对象
* 中 id 字段计算散列代码值。
* @return 此对象的散列代码值。
*/
@Override
public int hashCode() {
int hash = 0;
hash += (this.id != null ? this.id.hashCode() : 0);
return hash;
}
/**
* 确定其他对象是否等于此 Smoney。当且仅当
* 参数不为 null 且该参数是具有与此对象相同 id 字段值的 Smoney 对象时,
* 结果才为 <code>true</code>。
* @param 对象,要比较的引用对象
* 如果此对象与参数相同,则 @return <code>true</code>;
* 否则为 <code>false</code>。
*/
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Smoney)) {
return false;
}
Smoney other = (Smoney)object;
if (this.id != other.id && (this.id == null || !this.id.equals(other.id))) return false;
return true;
}
/**
* 返回对象的字符串表示法。该实现根据 id 字段
* 构造此表示法。
* @return 对象的字符串表示法。
*/
@Override
public String toString() {
return "com.classmoney.entity.Smoney[id=" + id + "]";
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -