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

📄 customer.java

📁 hibernate3.2.6源码和jar包
💻 JAVA
字号:
//$Id: Customer.java 11282 2007-03-14 22:05:59Z epbernard $package org.hibernate.test.annotations;import java.io.Serializable;import java.util.Collection;import java.util.SortedSet;import javax.persistence.CascadeType;import javax.persistence.Entity;import javax.persistence.FetchType;import javax.persistence.GeneratedValue;import javax.persistence.Id;import javax.persistence.JoinColumn;import javax.persistence.OneToMany;import javax.persistence.OneToOne;import org.hibernate.annotations.Cascade;import static org.hibernate.annotations.CascadeType.ALL;import org.hibernate.annotations.Sort;import org.hibernate.annotations.SortType;/** * Company customer * * @author Emmanuel Bernard */@Entitypublic class Customer implements Serializable {	Long id;	String name;	SortedSet<Ticket> tickets;	Collection discountTickets;	Passport passport;	public Customer() {	}	@Id	@GeneratedValue	public Long getId() {		return id;	}	public String getName() {		return name;	}	public void setId(Long long1) {		id = long1;	}	public void setName(String string) {		name = string;	}	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)	@JoinColumn(name = "CUST_ID")	@Sort(type = SortType.COMPARATOR, comparator = TicketComparator.class)	public SortedSet<Ticket> getTickets() {		return tickets;	}	public void setTickets(SortedSet<Ticket> tickets) {		this.tickets = tickets;	}	@OneToMany(targetEntity = org.hibernate.test.annotations.Discount.class,			cascade = CascadeType.ALL, mappedBy = "owner")	@Cascade({ALL})	public Collection getDiscountTickets() {		return discountTickets;	}	public void setDiscountTickets(Collection collection) {		discountTickets = collection;	}	@OneToOne(cascade = CascadeType.ALL)	public Passport getPassport() {		return passport;	}	public void setPassport(Passport passport) {		this.passport = passport;	}}

⌨️ 快捷键说明

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