clothes.java

来自「Hibernate Annotations Sample」· Java 代码 · 共 70 行

JAVA
70
字号
//$Id: Clothes.java 14736 2008-06-04 14:23:42Z hardy.ferentschik $package org.hibernate.test.annotations.referencedcolumnname;import javax.persistence.Entity;import javax.persistence.GeneratedValue;import javax.persistence.Id;/** * @author Emmanuel Bernard */@Entitypublic class Clothes {	private Integer id;	private String type;	private String flavor;	public Clothes() {	}	public Clothes(String type, String flavor) {		this.type = type;		this.flavor = flavor;	}	@Id	@GeneratedValue	public Integer getId() {		return id;	}	public void setId(Integer id) {		this.id = id;	}	public String getType() {		return type;	}	public void setType(String type) {		this.type = type;	}	public String getFlavor() {		return flavor;	}	public void setFlavor(String flavor) {		this.flavor = flavor;	}	public boolean equals(Object o) {		if ( this == o ) return true;		if ( !( o instanceof Clothes ) ) return false;		final Clothes clothes = (Clothes) o;		if ( !flavor.equals( clothes.flavor ) ) return false;		if ( !type.equals( clothes.type ) ) return false;		return true;	}	public int hashCode() {		int result;		result = type.hashCode();		result = 29 * result + flavor.hashCode();		return result;	}}

⌨️ 快捷键说明

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