📄 customer.java
字号:
//$Id: Customer.java,v 1.8 2004/12/28 22:19:27 epbernard Exp $package org.hibernate.test.metadata;import java.util.Collection;import java.util.Set;import java.io.Serializable;import javax.ejb.Entity;import javax.ejb.Id;import javax.ejb.Column;import javax.ejb.OneToMany;import javax.ejb.JoinColumn;import javax.ejb.CascadeType;import javax.ejb.GeneratorType;import javax.ejb.OneToOne;import javax.ejb.FetchType;/** * Company customer * @author Emmanuel Bernard */@Entitypublic class Customer implements Serializable { Long id; String name; Set<Ticket> tickets; Collection discountTickets; Passport passport; public Customer() { } @Id(generate = GeneratorType.AUTO) 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="CUSTOMER_ID") //FIXME: hibernate does not support column guess using the other side value public Set<Ticket> getTickets() { return tickets; } public void setTickets(Set<Ticket> tickets) { this.tickets = tickets; } @OneToMany(targetEntity="org.hibernate.test.metadata.Discount", cascade=CascadeType.ALL) @JoinColumn(name="CUSTOMER_ID") 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 + -