📄 product.java
字号:
package cn.hxex.library.model;
import java.util.Set;
/**
* 商品实体对象
*
* @author galaxy
*
*/
public class Product
{
// 主键
private String id;
// 商品名称
private String name;
// 商品描述信息
private String description;
// 商品分类
private Category category;
// 商品库存信息
private Set records;
/**
* @return Returns the records.
*/
public Set getRecords()
{
return records;
}
/**
* @param records The records to set.
*/
public void setRecords(Set records)
{
this.records = records;
}
/**
* @return Returns the category.
*/
public Category getCategory()
{
return category;
}
/**
* @param category The category to set.
*/
public void setCategory(Category category)
{
this.category = category;
}
/**
* Default constructor.
*/
public Product()
{
}
public String getId()
{
return this.id;
}
public void setId(String newId)
{
this.id = newId;
}
public String getName()
{
return this.name;
}
public void setName(String newName)
{
this.name = newName;
}
public String getDescription()
{
return this.description;
}
public void setDescription(String newDescription)
{
this.description = newDescription;
}
public int hashcode()
{
if( id!=null )
this.id.hashCode();
return 0;
}
public boolean equals( Object obj )
{
if( obj==null ) return false;
if( this==obj ) return true;
if( obj instanceof Product )
{
if( this.id!=null )
return this.id.equals( ((Product)obj).getId() );
}
return false;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -