basebuilding.java

来自「一个购房管理系统,JSF+Hibernate+Mssql2」· Java 代码 · 共 238 行

JAVA
238
字号
package com.housesale.hibernate.base;

import java.io.Serializable;


/**
 * This is an object that contains data related to the Building table.
 * Do not modify this class because it will be overwritten if the configuration file
 * related to this class is modified.
 *
 * @hibernate.class
 *  table="Building"
 */

public abstract class BaseBuilding  implements Serializable {

	public static String REF = "Building";
	public static String PROP_BUILDING_NAME = "buildingName";
	public static String PROP_IMAGE2 = "image2";
	public static String PROP_BUILDING_ID = "buildingId";
	public static String PROP_COMMUNITY = "community";
	public static String PROP_IMAGE1 = "image1";
	public static String PROP_BZ = "bz";
	public static String PROP_INTRODUCE = "introduce";


	// constructors
	public BaseBuilding () {
		initialize();
	}

	/**
	 * Constructor for primary key
	 */
	public BaseBuilding (java.lang.Integer buildingId) {
		this.setBuildingId(buildingId);
		initialize();
	}

	protected void initialize () {}



	private int hashCode = Integer.MIN_VALUE;

	// primary key
	private java.lang.Integer buildingId;

	// fields
	private java.lang.String buildingName;
	private java.lang.String introduce;
	private byte[] image1;
	private byte[] image2;
	private java.lang.String bz;

	// many to one
	private com.housesale.hibernate.Community community;

	// collections
	private java.util.Set<com.housesale.hibernate.HouseStyle> houseStyles;



	/**
	 * Return the unique identifier of this class
     * @hibernate.id
     *  generator-class="assigned"
     *  column="BuildingID"
     */
	public java.lang.Integer getBuildingId () {
		return buildingId;
	}

	/**
	 * Set the unique identifier of this class
	 * @param buildingId the new ID
	 */
	public void setBuildingId (java.lang.Integer buildingId) {
		this.buildingId = buildingId;
		this.hashCode = Integer.MIN_VALUE;
	}




	/**
	 * Return the value associated with the column: BuildingName
	 */
	public java.lang.String getBuildingName () {
		return buildingName;
	}

	/**
	 * Set the value related to the column: BuildingName
	 * @param buildingName the BuildingName value
	 */
	public void setBuildingName (java.lang.String buildingName) {
		this.buildingName = buildingName;
	}



	/**
	 * Return the value associated with the column: Introduce
	 */
	public java.lang.String getIntroduce () {
		return introduce;
	}

	/**
	 * Set the value related to the column: Introduce
	 * @param introduce the Introduce value
	 */
	public void setIntroduce (java.lang.String introduce) {
		this.introduce = introduce;
	}



	/**
	 * Return the value associated with the column: Image1
	 */
	public byte[] getImage1 () {
		return image1;
	}

	/**
	 * Set the value related to the column: Image1
	 * @param image1 the Image1 value
	 */
	public void setImage1 (byte[] image1) {
		this.image1 = image1;
	}



	/**
	 * Return the value associated with the column: Image2
	 */
	public byte[] getImage2 () {
		return image2;
	}

	/**
	 * Set the value related to the column: Image2
	 * @param image2 the Image2 value
	 */
	public void setImage2 (byte[] image2) {
		this.image2 = image2;
	}



	/**
	 * Return the value associated with the column: Bz
	 */
	public java.lang.String getBz () {
		return bz;
	}

	/**
	 * Set the value related to the column: Bz
	 * @param bz the Bz value
	 */
	public void setBz (java.lang.String bz) {
		this.bz = bz;
	}



	/**
	 * Return the value associated with the column: CommunityID
	 */
	public com.housesale.hibernate.Community getCommunity () {
		return community;
	}

	/**
	 * Set the value related to the column: CommunityID
	 * @param community the CommunityID value
	 */
	public void setCommunity (com.housesale.hibernate.Community community) {
		this.community = community;
	}



	/**
	 * Return the value associated with the column: houseStyles
	 */
	public java.util.Set<com.housesale.hibernate.HouseStyle> getHouseStyles () {
		return houseStyles;
	}

	/**
	 * Set the value related to the column: houseStyles
	 * @param houseStyles the houseStyles value
	 */
	public void setHouseStyles (java.util.Set<com.housesale.hibernate.HouseStyle> houseStyles) {
		this.houseStyles = houseStyles;
	}

	public void addTohouseStyles (com.housesale.hibernate.HouseStyle houseStyle) {
		if (null == getHouseStyles()) setHouseStyles(new java.util.TreeSet<com.housesale.hibernate.HouseStyle>());
		getHouseStyles().add(houseStyle);
	}




	public boolean equals (Object obj) {
		if (null == obj) return false;
		if (!(obj instanceof com.housesale.hibernate.Building)) return false;
		else {
			com.housesale.hibernate.Building building = (com.housesale.hibernate.Building) obj;
			if (null == this.getBuildingId() || null == building.getBuildingId()) return false;
			else return (this.getBuildingId().equals(building.getBuildingId()));
		}
	}

	public int hashCode () {
		if (Integer.MIN_VALUE == this.hashCode) {
			if (null == this.getBuildingId()) return super.hashCode();
			else {
				String hashStr = this.getClass().getName() + ":" + this.getBuildingId().hashCode();
				this.hashCode = hashStr.hashCode();
			}
		}
		return this.hashCode;
	}


	public String toString () {
		return super.toString();
	}


}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?