📄 javafish.java
字号:
/*
* WARNING: DO NOT EDIT THIS FILE. This is a generated file that is synchronized
* by MyEclipse Hibernate tool integration.
*
* Created Fri Nov 25 23:57:47 CST 2005 by MyEclipse Hibernate Tool.
*/
package javafish.model;
import java.io.Serializable;
import org.apache.commons.lang.builder.ToStringBuilder;
/**
* A class that represents a row in the javafish table.
* You can customize the behavior of this class by editing the class, {@link Javafish()}.
* WARNING: DO NOT EDIT THIS FILE. This is a generated file that is synchronized * by MyEclipse Hibernate tool integration.
*/
//Hibernate建议我们的持久化类最好可以实现Serializable。
public class JavaFish implements Serializable
{
/** The cached hash code value for this instance. Settting to 0 triggers re-calculation. */
private int hashValue = 0;
/** The composite primary key value. */
private java.lang.Long id;
/** The value of the simple username property. */
private java.lang.String username;
/** The value of the simple password property. */
private java.lang.String password;
/**
* Simple constructor of AbstractJavafish instances.
*/
//Hibernate建议我们给我们的pojo提供默认构造器
public JavaFish()
{
}
/**
* Constructor of AbstractJavafish instances given a simple primary key.
* @param id
*/
public JavaFish(java.lang.Long id)
{
this.setId(id);
}
/**
* Return the simple primary key value that identifies this object.
* @return java.lang.Long
*/
public java.lang.Long getId()
{
return id;
}
/**
* Set the simple primary key value that identifies this object.
* @param id
*/
public void setId(java.lang.Long id)
{
this.hashValue = 0;
this.id = id;
}
/**
* Return the value of the USERNAME column.
* @return java.lang.String
*/
public java.lang.String getUsername()
{
return this.username;
}
/**
* Set the value of the USERNAME column.
* @param username
*/
public void setUsername(java.lang.String username)
{
this.username = username;
}
/**
* Return the value of the PASSWORD column.
* @return java.lang.String
*/
public java.lang.String getPassword()
{
return this.password;
}
/**
* Set the value of the PASSWORD column.
* @param password
*/
public void setPassword(java.lang.String password)
{
this.password = password;
}
/**
* Implementation of the equals comparison on the basis of equality of the primary key values.
* @param rhs
* @return boolean
*/
//hibernate建议我们自己实现equals方法
public boolean equals(Object obj)
{
if(this==obj) return true;
if(!(obj instanceof JavaFish)) return false;
final JavaFish javafish=(JavaFish)obj;
if(!username.equals(javafish.username)) return false;
if(!password.equals(javafish.password)) return false;
return true;
}
/**
* Implementation of the hashCode method conforming to the Bloch pattern with
* the exception of array properties (these are very unlikely primary key types).
* @return int
*/
//hibernate建议我们自己实现hashCode方法
public int hashCode()
{
int result;
result=(username==null?0:username.hashCode());
result=29*result+(password==null?0:password.hashCode());
return result;
}
//hibernate建议我们实现toString()方法
public String toString()
{
return new ToStringBuilder(this)
.append("id",getId())
.append("username",getUsername())
.append("password",getPassword())
.toString();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -