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

📄 cruise.java

📁 This book shows you how to use JBoss to develop EJB projects.
💻 JAVA
字号:
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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -