📄 pets.java
字号:
package org.springframework.samples.annotations;
// Generated 2006-10-27 18:36:22 by Hibernate Tools 3.2.0.beta8
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
/**
* Pets generated by hbm2java
*/
@Entity
@Table(name="PETS"
, uniqueConstraints = { }
)
public class Pets implements java.io.Serializable {
// Fields
private int id;
private Types types;
private Owners owners;
private String name;
private Date birthDate;
private Set<Visits> visitses = new HashSet<Visits>(0);
// Constructors
/** default constructor */
public Pets() {
}
/** minimal constructor */
public Pets(int id, Types types, Owners owners) {
this.id = id;
this.types = types;
this.owners = owners;
}
/** full constructor */
public Pets(int id, Types types, Owners owners, String name, Date birthDate, Set<Visits> visitses) {
this.id = id;
this.types = types;
this.owners = owners;
this.name = name;
this.birthDate = birthDate;
this.visitses = visitses;
}
// Property accessors
@Id
@Column(name="ID", unique=true, nullable=false, insertable=true, updatable=true)
public int getId() {
return this.id;
}
public void setId(int id) {
this.id = id;
}
@ManyToOne(cascade={},
fetch=FetchType.LAZY)
@JoinColumn(name="TYPE_ID", unique=false, nullable=false, insertable=true, updatable=true)
public Types getTypes() {
return this.types;
}
public void setTypes(Types types) {
this.types = types;
}
@ManyToOne(cascade={},
fetch=FetchType.LAZY)
@JoinColumn(name="OWNER_ID", unique=false, nullable=false, insertable=true, updatable=true)
public Owners getOwners() {
return this.owners;
}
public void setOwners(Owners owners) {
this.owners = owners;
}
@Column(name="NAME", unique=false, nullable=true, insertable=true, updatable=true, length=30)
public String getName() {
return this.name;
}
public void setName(String name) {
this.name = name;
}
@Temporal(TemporalType.DATE)
@Column(name="BIRTH_DATE", unique=false, nullable=true, insertable=true, updatable=true, length=0)
public Date getBirthDate() {
return this.birthDate;
}
public void setBirthDate(Date birthDate) {
this.birthDate = birthDate;
}
@OneToMany(cascade={CascadeType.ALL}, fetch=FetchType.LAZY, mappedBy="pets")
public Set<Visits> getVisitses() {
return this.visitses;
}
public void setVisitses(Set<Visits> visitses) {
this.visitses = visitses;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -