friendship.java
来自「一个使用Java实现的类似与QQ的聊天程序。使用了Hibernate组建。可用于」· Java 代码 · 共 96 行
JAVA
96 行
package com.jim.database;
/**
* Friendship generated by MyEclipse - Hibernate Tools
*/
public class Friendship implements java.io.Serializable {
// Fields
/**
*
*/
private static final long serialVersionUID = -2864336006932453976L;
private Integer id;
private Integer masterno;
private Integer subno;
// Constructors
/** default constructor */
public Friendship() {
}
public Friendship(int mNo,int sNo){
this.masterno = new Integer(mNo);
this.subno = new Integer(sNo);
}
/** full constructor */
public Friendship(Integer masterno, Integer subno) {
this.masterno = masterno;
this.subno = subno;
}
// Property accessors
public Integer getId() {
return this.id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getMasterno() {
return this.masterno;
}
public void setMasterno(Integer masterno) {
this.masterno = masterno;
}
public Integer getSubno() {
return this.subno;
}
public void setSubno(Integer subno) {
this.subno = subno;
}
@Override
public boolean equals(Object obj) {
if(this == obj)
return true;
if(!(obj instanceof Friendship))
return false;
Friendship another = (Friendship)obj;
if(another.getMasterno().equals(masterno)
&& another.getSubno().equals(subno))
return true;
return false;
}
@Override
public int hashCode() {
int ret;
ret = masterno.hashCode();
ret = ret*9 - subno.hashCode();
return ret;
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?