Use this tag for questions related to the *mapping* in Hibernate and is called Table Per Subclass.
Questions tagged [table-per-subclass]
22 questions
0
votes
1 answer
hibernate inheritance for an online library/shop design implementation choice
I wish to implement an online library in hibernate. Here is my sql sschema:
Between Book and Programming book I am thinking of using hibernate inheritance of type table per subclass joined. I designed the sql schema this way because I don't see the…

adragomir
- 457
- 4
- 16
- 33
0
votes
1 answer
Disable possibility to update subclasses
I am developing a inheritance strategy in fluent nhibernate. Everything works correctly but I have a one question. Is there any possibility to disable updating base property through the subclass?
Here is a dummy code:
public class ObjectA
{
…

Marek
- 193
- 1
- 2
- 11
0
votes
1 answer
@OneToMany relationship property not filled
I have implemented Joined, Multiple Table Inheritance.
There is a 'parent' table pois and two sub tables: xPois and yPois and in turn I have an abstract PoiDao class as well as a XPoiDao and a YPoiDao class extending PoiDao.
A poi may have multiple…

du-it
- 2,561
- 8
- 42
- 80
0
votes
1 answer
Hibernate - inheritance
I have a super class called userDetailsSuper which is mapped to another table called Address.
@Entity
@Table (name = "USER_DETAILS_SUPER")
@Inheritance (strategy = InheritanceType.JOINED )
public class UserDetailsSuper
{
private long…

user2768984
- 57
- 1
- 11
0
votes
1 answer
How does EF map non-abstract base types when ToTable isn't called?
I am using EF5 Code-first with entity classes like so:
public class Base {
public int Id { get; set; }
}
public class Derived : Base { // there are other derived types as well
}
and then I configure the derived entity as follows:
var config =…

ChaseMedallion
- 20,860
- 17
- 88
- 152
0
votes
1 answer
Code First - Mapping when the Discriminator IS NULL or NOT NULL
I want to use TPH Inheritance in EF5 Code First. I want to base it on whether a column in the database is null or not.
I found this link indicating it was not possible in EF4. Entity Framework 4 - TPH Inheritance in Features CTP5 (code first) with…

Chris
- 1,690
- 2
- 17
- 24
0
votes
1 answer
Hibernate, sub-classing and the visitor pattern
I might be using the wrong word so when I say Business Object (BO) I mean a class with a reference to the class that's mapped to a database-table with Hibernate, as well as business logic.
The problem I'm facing is instantiating the right BO for…

user1540134
- 5
- 3