cruise.java
来自「This book shows you how to use JBoss to 」· Java 代码 · 共 37 行
JAVA
37 行
package com.titan.domain;
import java.util.*;
import javax.persistence.*;
@Entity
public class Cruise implements java.io.Serializable
{
private int id;
private String name;
private Ship ship;
private Collection<Reservation> reservations = new ArrayList<Reservation>();
public Cruise() {}
public Cruise(String name, Ship ship)
{
this.name = name;
this.ship = ship;
}
@Id @GeneratedValue
public int getId() { return id; }
public void setId(int id) { this.id = id; }
public String getName( ) { return name; }
public void setName(String name) { this.name = name; }
@ManyToOne
public Ship getShip() { return ship; }
public void setShip(Ship ship) { this.ship = ship; }
@OneToMany(mappedBy="cruise")
public Collection<Reservation> getReservations() { return reservations; }
public void setReservations(Collection<Reservation> res) { reservations = res; }
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?