⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cat.java

📁 白广元写的java web整合开发完全自学手册的源代码
💻 JAVA
字号:
package hibernate3.object;

import java.awt.Color;
import java.util.HashSet;
import java.util.Set;
import java.util.Date;

public class Cat {
	private Long id; // identifier

	private Date birthdate;
	private Color color;
	private char sex;
	private float weight;
	private int litterId;

	private Cat mother;
	private Set kittens = new HashSet();

	private void setId(Long id) {
		this.id = id;
	}

	public Long getId() {
		return id;
	}

	void setBirthdate(Date date) {
		birthdate = date;
	}

	public Date getBirthdate() {
		return birthdate;
	}

	void setWeight(float weight) {
		this.weight = weight;
	}

	public float getWeight() {
		return weight;
	}

	public Color getColor() {
		return color;
	}

	void setColor(Color color) {
		this.color = color;
	}

	void setSex(char sex) {
		this.sex = sex;
	}

	public char getSex() {
		return sex;
	}

	void setLitterId(int id) {
		this.litterId = id;
	}

	public int getLitterId() {
		return litterId;
	}

	void setMother(Cat mother) {
		this.mother = mother;
	}

	public Cat getMother() {
		return mother;
	}

	void setKittens(Set kittens) {
		this.kittens = kittens;
	}
	public Set getKittens() {
		return kittens;
	}

	// addKitten not needed by Hibernate
	public void addKitten(Cat kitten) {
		kitten.setMother(this);
		kitten.setLitterId(kittens.size());
		kittens.add(kitten);
	}
}

⌨️ 快捷键说明

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