📄 dtpropertiespk.java
字号:
/*
* DtpropertiesPK.java
*
* Created on 2007年6月4日, 下午10:07
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package temp;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Embeddable;
/**
* 实体类 Dtproperties 的主键类 DtpropertiesPK
*
* @author Virlene Cheng
*/
@Embeddable
public class DtpropertiesPK implements Serializable
{
@Column(name = "id", nullable = false)
private int id;
@Column(name = "property", nullable = false)
private String property;
/** Creates a new instance of DtpropertiesPK */
public DtpropertiesPK()
{
}
/**
* 使用指定的值创建 DtpropertiesPK 的新实例。
* @param property,DtpropertiesPK 的 property
* @param id,DtpropertiesPK 的 id
*/
public DtpropertiesPK(String property, int id)
{
this.property = property;
this.id = id;
}
/**
* 获取此 DtpropertiesPK 的 id。
* @return id
*/
public int getId()
{
return this.id;
}
/**
* 将此 DtpropertiesPK 的 id 设置为指定的值。
* @param id,新建 id
*/
public void setId(int id)
{
this.id = id;
}
/**
* 获取此 DtpropertiesPK 的 property。
* @return property
*/
public String getProperty()
{
return this.property;
}
/**
* 将此 DtpropertiesPK 的 property 设置为指定的值。
* @param property,新建 property
*/
public void setProperty(String property)
{
this.property = property;
}
/**
* 返回对象的散列代码值。该实现根据此对象
* 中 id 字段计算散列代码值。
* @return 此对象的散列代码值。
*/
@Override
public int hashCode()
{
int hash = 0;
hash += (this.property != null ? this.property.hashCode() : 0);
hash += (int)id;
return hash;
}
/**
* 确定其他对象是否等于此 DtpropertiesPK。当且仅当
* 参数不为 null 且该参数是具有与此对象相同 id 字段值的 DtpropertiesPK 对象时,
* 结果才为 <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 DtpropertiesPK)) {
return false;
}
DtpropertiesPK other = (DtpropertiesPK)object;
if (this.property != other.property && (this.property == null || !this.property.equals(other.property))) return false;
if (this.id != other.id) return false;
return true;
}
/**
* 返回对象的字符串表示法。该实现根据 id 字段
* 构造此表示法。
* @return 对象的字符串表示法。
*/
@Override
public String toString()
{
return "temp.DtpropertiesPK[property=" + property + ", id=" + id + "]";
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -