📄 menuinfo.java
字号:
/*
* MenuInfo.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 java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
/**
* 实体类 MenuInfo
*
* @author Virlene Cheng
*/
@Entity
@Table(name = "MenuInfo")
public class MenuInfo implements Serializable
{
@Id
@Column(name = "MenuId", nullable = false)
private String menuId;
@Column(name = "GuestAccouts", nullable = false)
private String guestAccouts;
@Column(name = "FoodType")
private String foodType;
@Column(name = "Unit")
private String unit;
@Column(name = "UnitPrice")
private Double unitPrice;
@Column(name = "Amount")
private Double amount;
@Column(name = "Agio")
private Double agio;
@Column(name = "ConsumeDate")
@Temporal(TemporalType.TIMESTAMP)
private Date consumeDate;
@Column(name = "IsCheckout", nullable = false)
private char isCheckout;
@JoinColumn(name = "FoodId", referencedColumnName = "FoodId")
@ManyToOne
private FoodInfo foodId;
@JoinColumn(name = "TableId", referencedColumnName = "TableId")
@ManyToOne
private TableInfo tableId;
/** Creates a new instance of MenuInfo */
public MenuInfo()
{
}
/**
* 使用指定的值创建 MenuInfo 的新实例。
* @param menuId,MenuInfo 的 menuId
*/
public MenuInfo(String menuId)
{
this.menuId = menuId;
}
/**
* 使用指定的值创建 MenuInfo 的新实例。
* @param menuId,MenuInfo 的 menuId
* @param guestAccouts,MenuInfo 的 guestAccouts
* @param isCheckout,MenuInfo 的 isCheckout
*/
public MenuInfo(String menuId, String guestAccouts, char isCheckout)
{
this.menuId = menuId;
this.guestAccouts = guestAccouts;
this.isCheckout = isCheckout;
}
/**
* 获取此 MenuInfo 的 menuId。
* @return menuId
*/
public String getMenuId()
{
return this.menuId;
}
/**
* 将此 MenuInfo 的 menuId 设置为指定的值。
* @param menuId,新建 menuId
*/
public void setMenuId(String menuId)
{
this.menuId = menuId;
}
/**
* 获取此 MenuInfo 的 guestAccouts。
* @return guestAccouts
*/
public String getGuestAccouts()
{
return this.guestAccouts;
}
/**
* 将此 MenuInfo 的 guestAccouts 设置为指定的值。
* @param guestAccouts,新建 guestAccouts
*/
public void setGuestAccouts(String guestAccouts)
{
this.guestAccouts = guestAccouts;
}
/**
* 获取此 MenuInfo 的 foodType。
* @return foodType
*/
public String getFoodType()
{
return this.foodType;
}
/**
* 将此 MenuInfo 的 foodType 设置为指定的值。
* @param foodType,新建 foodType
*/
public void setFoodType(String foodType)
{
this.foodType = foodType;
}
/**
* 获取此 MenuInfo 的 unit。
* @return unit
*/
public String getUnit()
{
return this.unit;
}
/**
* 将此 MenuInfo 的 unit 设置为指定的值。
* @param unit,新建 unit
*/
public void setUnit(String unit)
{
this.unit = unit;
}
/**
* 获取此 MenuInfo 的 unitPrice。
* @return unitPrice
*/
public Double getUnitPrice()
{
return this.unitPrice;
}
/**
* 将此 MenuInfo 的 unitPrice 设置为指定的值。
* @param unitPrice,新建 unitPrice
*/
public void setUnitPrice(Double unitPrice)
{
this.unitPrice = unitPrice;
}
/**
* 获取此 MenuInfo 的 amount。
* @return amount
*/
public Double getAmount()
{
return this.amount;
}
/**
* 将此 MenuInfo 的 amount 设置为指定的值。
* @param amount,新建 amount
*/
public void setAmount(Double amount)
{
this.amount = amount;
}
/**
* 获取此 MenuInfo 的 agio。
* @return agio
*/
public Double getAgio()
{
return this.agio;
}
/**
* 将此 MenuInfo 的 agio 设置为指定的值。
* @param agio,新建 agio
*/
public void setAgio(Double agio)
{
this.agio = agio;
}
/**
* 获取此 MenuInfo 的 consumeDate。
* @return consumeDate
*/
public Date getConsumeDate()
{
return this.consumeDate;
}
/**
* 将此 MenuInfo 的 consumeDate 设置为指定的值。
* @param consumeDate,新建 consumeDate
*/
public void setConsumeDate(Date consumeDate)
{
this.consumeDate = consumeDate;
}
/**
* 获取此 MenuInfo 的 isCheckout。
* @return isCheckout
*/
public char getIsCheckout()
{
return this.isCheckout;
}
/**
* 将此 MenuInfo 的 isCheckout 设置为指定的值。
* @param isCheckout,新建 isCheckout
*/
public void setIsCheckout(char isCheckout)
{
this.isCheckout = isCheckout;
}
/**
* 获取此 MenuInfo 的 foodId。
* @return foodId
*/
public FoodInfo getFoodId()
{
return this.foodId;
}
/**
* 将此 MenuInfo 的 foodId 设置为指定的值。
* @param foodId,新建 foodId
*/
public void setFoodId(FoodInfo foodId)
{
this.foodId = foodId;
}
/**
* 获取此 MenuInfo 的 tableId。
* @return tableId
*/
public TableInfo getTableId()
{
return this.tableId;
}
/**
* 将此 MenuInfo 的 tableId 设置为指定的值。
* @param tableId,新建 tableId
*/
public void setTableId(TableInfo tableId)
{
this.tableId = tableId;
}
/**
* 返回对象的散列代码值。该实现根据此对象
* 中 id 字段计算散列代码值。
* @return 此对象的散列代码值。
*/
@Override
public int hashCode()
{
int hash = 0;
hash += (this.menuId != null ? this.menuId.hashCode() : 0);
return hash;
}
/**
* 确定其他对象是否等于此 MenuInfo。当且仅当
* 参数不为 null 且该参数是具有与此对象相同 id 字段值的 MenuInfo 对象时,
* 结果才为 <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 MenuInfo)) {
return false;
}
MenuInfo other = (MenuInfo)object;
if (this.menuId != other.menuId && (this.menuId == null || !this.menuId.equals(other.menuId))) return false;
return true;
}
/**
* 返回对象的字符串表示法。该实现根据 id 字段
* 构造此表示法。
* @return 对象的字符串表示法。
*/
@Override
public String toString()
{
return "temp.MenuInfo[menuId=" + menuId + "]";
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -