Jochen Morent
Grünschnabel
I have to make the domain-layer of a collage project. We have few standards, like we have to use Hibernate and the database also is fix.
The relevant part of the database looks nearly like that:
BusEntitys (Table 1)
BusType (Table 2)
The problem I have is that there are 2 types of buses in the domain-layer distinguish by the discriminator in the BusType-table:
Is there a way to map something like this with Hibernate and JPA? Thanks for every answer.
Jochen Morent
The relevant part of the database looks nearly like that:
BusEntitys (Table 1)
- BusId
- Bus specific information
BusType (Table 2)
- BusTypeId
- Seats
- ...
- SubClass Discriminator
The problem I have is that there are 2 types of buses in the domain-layer distinguish by the discriminator in the BusType-table:
Code:
@Entity
class Bus
{
@Id
int _id;
...
}
Code:
@Entity
class BusSubClass1 extends Bus
{
...
}
Code:
@Entity
class BusSubClass2 extends Bus
{
...
}
Is there a way to map something like this with Hibernate and JPA? Thanks for every answer.
Jochen Morent