animal.java

来自「介绍了hibernate的入门有一些基本常用的事例」· Java 代码 · 共 91 行

JAVA
91
字号
//$Id: Animal.java,v 1.4 2005/02/28 20:18:28 steveebersole Exp $package org.hibernate.test.hql;import java.util.Set;import java.util.HashSet;/** * @author Gavin King */public class Animal {	private Long id;	private float bodyWeight;	private Set offspring;	private Animal mother;	private Animal father;	private String description;	private Zoo zoo;	public Animal() {	}	public Animal(String description, float bodyWeight) {		this.description = description;		this.bodyWeight = bodyWeight;	}	public Long getId() {		return id;	}	public void setId(Long id) {		this.id = id;	}	public float getBodyWeight() {		return bodyWeight;	}	public void setBodyWeight(float bodyWeight) {		this.bodyWeight = bodyWeight;	}	public Set getOffspring() {		return offspring;	}	public void addOffspring(Animal offspring) {		if ( this.offspring == null ) {			this.offspring = new HashSet();		}		this.offspring.add( offspring );	}	public void setOffspring(Set offspring) {		this.offspring = offspring;	}	public Animal getMother() {		return mother;	}	public void setMother(Animal mother) {		this.mother = mother;	}	public Animal getFather() {		return father;	}	public void setFather(Animal father) {		this.father = father;	}	public String getDescription() {		return description;	}	public void setDescription(String description) {		this.description = description;	}	public Zoo getZoo() {		return zoo;	}	public void setZoo(Zoo zoo) {		this.zoo = zoo;	}}

⌨️ 快捷键说明

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