Auto World 詳細資料

Auto World 範例包含以根/葉繼承關係來建置的 EJB 2.0 Entity Bean,具有儲存器管理的持續性 (CMP)。

Vehicle 是根 Enterprise Bean,所有葉 Enterprise Bean 皆衍生自此。 葉包括 RaceCar、Bus 及 SUV。此外,Auto World 範例還包含 Garage 和 MotorVehiclePart 的一對多關係, 以及 VapUSPhoneNumber(Vehicle 的實體欄位)的自訂編輯器。 所有 Enterprise Bean 上皆以搜尋器來尋找持續性物件的所有實例。

EJB 專案包含下列 Enterprise Bean:
  • Vehicle: 根 Enterprise Bean,CMP 欄位包括:id、dateAcquired 及 cellphone
  • Automobile: 繼承自 Vehicle 且增加 CMP 欄位:numberOfAirBags RaceCar: 繼承自 Automobile 且增加 CMP 欄位:topSpeed
  • Bus: 繼承自 Vehicle 且增加 CMP 欄位:maximumPassengers
  • Truck: 繼承自 Vehicle 且增加 CMP 欄位:MaximumLoad、numberOfWheels
  • SUV: 繼承自 Truck 但沒有增加 CMP 欄位
  • Garage: 與 Vehicle 之間有一對多關聯,且包含下列 CMP 欄位:id、capacity
  • MotorVehiclePart: 與 Vehicle 之間有多對一關聯,且包含下列 CMP 欄位:partId、description
上層主題: Auto World

意見