?? baseitem.java
字號:
package org.yeeku.model.base;
import java.lang.Comparable;
import java.io.Serializable;
import java.util.HashSet;
/**
* This is an object that contains data related to the item table.
* Do not modify this class because it will be overwritten if the configuration file
* related to this class is modified.
*
* @hibernate.class
* table="item"
*/
public abstract class BaseItem implements Comparable, Serializable {
public static String REF = "Item";
public static String PROP_INIT_PRICE = "InitPrice";
public static String PROP_OWNER = "Owner";
public static String PROP_ITEM_NAME = "ItemName";
public static String PROP_KIND = "Kind";
public static String PROP_ITEM_STATE = "ItemState";
public static String PROP_MAX_PRICE = "MaxPrice";
public static String PROP_WINER = "Winer";
public static String PROP_ITEM_PIC = "ItemPic";
public static String PROP_ITEM_DESC = "ItemDesc";
public static String PROP_ID = "Id";
public static String PROP_ENDTIME = "Endtime";
public static String PROP_ADDTIME = "Addtime";
// constructors
public BaseItem () {
initialize();
}
/**
* Constructor for primary key
*/
public BaseItem (java.lang.Integer id) {
this.setId(id);
initialize();
}
/**
* Constructor for required fields
*/
public BaseItem (
java.lang.Integer id,
org.yeeku.model.AuctionUser owner,
org.yeeku.model.AuctionUser winer,
org.yeeku.model.Kind kind,
java.lang.String itemPic,
java.lang.String itemName,
java.lang.String itemDesc,
java.util.Date endtime,
java.util.Date addtime,
java.lang.Double initPrice,
java.lang.Double maxPrice,
org.yeeku.model.State itemState) {
this.setId(id);
this.setOwner(owner);
this.setWiner(winer);
this.setKind(kind);
this.setItemPic(itemPic);
this.setItemName(itemName);
this.setItemDesc(itemDesc);
this.setEndtime(endtime);
this.setAddtime(addtime);
this.setInitPrice(initPrice);
this.setMaxPrice(maxPrice);
this.setItemState(itemState);
initialize();
}
protected void initialize () {}
private int hashCode = Integer.MIN_VALUE;
// primary key
private java.lang.Integer id;
// fields
private java.lang.String itemPic;
private java.lang.String itemName;
private java.lang.String itemDesc;
private java.util.Date endtime;
private java.util.Date addtime;
private java.lang.Double initPrice;
private java.lang.Double maxPrice;
// many to one
private org.yeeku.model.AuctionUser owner;
private org.yeeku.model.Kind kind;
private org.yeeku.model.AuctionUser winer;
private org.yeeku.model.State itemState;
// collections
private java.util.Set bids = new HashSet();
/**
* Return the unique identifier of this class
* @hibernate.id
* generator-class="increment"
* column="item_id"
*/
public java.lang.Integer getId () {
return id;
}
/**
* Set the unique identifier of this class
* @param id the new ID
*/
public void setId (java.lang.Integer id) {
this.id = id;
this.hashCode = Integer.MIN_VALUE;
}
/**
* Return the value associated with the column: item_pic
*/
public java.lang.String getItemPic () {
return itemPic;
}
/**
* Set the value related to the column: item_pic
* @param itemPic the item_pic value
*/
public void setItemPic (java.lang.String itemPic) {
this.itemPic = itemPic;
}
/**
* Return the value associated with the column: item_name
*/
public java.lang.String getItemName () {
return itemName;
}
/**
* Set the value related to the column: item_name
* @param itemName the item_name value
*/
public void setItemName (java.lang.String itemName) {
this.itemName = itemName;
}
/**
* Return the value associated with the column: item_desc
*/
public java.lang.String getItemDesc () {
return itemDesc;
}
/**
* Set the value related to the column: item_desc
* @param itemDesc the item_desc value
*/
public void setItemDesc (java.lang.String itemDesc) {
this.itemDesc = itemDesc;
}
/**
* Return the value associated with the column: endtime
*/
public java.util.Date getEndtime () {
return endtime;
}
/**
* Set the value related to the column: endtime
* @param endtime the endtime value
*/
public void setEndtime (java.util.Date endtime) {
this.endtime = endtime;
}
/**
* Return the value associated with the column: addtime
*/
public java.util.Date getAddtime () {
return addtime;
}
/**
* Set the value related to the column: addtime
* @param endtime the addtime value
*/
public void setAddtime (java.util.Date addtime) {
this.addtime = addtime;
}
/**
* Return the value associated with the column: init_price
*/
public java.lang.Double getInitPrice () {
return initPrice;
}
/**
* Set the value related to the column: init_price
* @param initPrice the init_price value
*/
public void setInitPrice (java.lang.Double initPrice) {
this.initPrice = initPrice;
}
/**
* Return the value associated with the column: max_price
*/
public java.lang.Double getMaxPrice () {
return maxPrice;
}
/**
* Set the value related to the column: max_price
* @param maxPrice the max_price value
*/
public void setMaxPrice (java.lang.Double maxPrice) {
this.maxPrice = maxPrice;
}
/**
* Return the value associated with the column: owner_id
*/
public org.yeeku.model.AuctionUser getOwner () {
return owner;
}
/**
* Set the value related to the column: owner_id
* @param owner the owner_id value
*/
public void setOwner (org.yeeku.model.AuctionUser owner) {
this.owner = owner;
}
/**
* Return the value associated with the column: item_state
*/
public org.yeeku.model.State getItemState () {
return itemState;
}
/**
* Set the value related to the column: item_state
* @param owner the item_state value
*/
public void setItemState (org.yeeku.model.State is) {
this.itemState = is;
}
/**
* Return the value associated with the column: kind_id
*/
public org.yeeku.model.Kind getKind () {
return kind;
}
/**
* Set the value related to the column: kind_id
* @param kind the kind_id value
*/
public void setKind (org.yeeku.model.Kind kind) {
this.kind = kind;
}
/**
* Return the value associated with the column: winer_id
*/
public org.yeeku.model.AuctionUser getWiner () {
return winer;
}
/**
* Set the value related to the column: winer_id
* @param winer the winer_id value
*/
public void setWiner (org.yeeku.model.AuctionUser winer) {
this.winer = winer;
}
/**
* Return the value associated with the column: Bids
*/
public java.util.Set getBids () {
return bids;
}
/**
* Set the value related to the column: Bids
* @param bids the Bids value
*/
public void setBids (java.util.Set bids) {
this.bids = bids;
}
public boolean equals (Object obj) {
if (null == obj) return false;
if (!(obj instanceof org.yeeku.model.Item)) return false;
else {
org.yeeku.model.Item item = (org.yeeku.model.Item) obj;
if (null == this.getOwner() || null == item.getOwner()
|| null == this.getAddtime() || null == item.getAddtime()) return false;
else return (this.getOwner().equals(item.getOwner())
&& this.getAddtime().equals(item.getAddtime()));
}
}
public int hashCode () {
return addtime.hashCode() + owner.hashCode();
}
public int compareTo (Object obj) {
if (obj.hashCode() > hashCode()) return 1;
else if (obj.hashCode() < hashCode()) return -1;
else return 0;
}
public String toString () {
return super.toString();
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -