Hi,
I'm using a mixed inheritance strategy; described in the book 'Hibernate in Action' (5.1.5) - mixing InheritanceType.SINGLE_TABLE with Secondary Table.
The base class:
Code:
@Entity
@Table(name = "BASE")
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
public class Base {
...
}
One subclass:
Code:
@Entity
@DiscriminatorValue("V")
@SecondaryTable(
name = "SUB",
pkJoinColumns = @PrimaryKeyJoinColumn(name = "F_ID")
)
@Table(
appliesTo = "SUB",
fetch = FetchMode.SELECT,
optional = false,
inverse = false
)
public class Sub extends Base {
...
}
I have used 'FetchMode.SELECT' to force a inner join (instead of an outer join). What is the problem? Some of the subclasses has @Formula's. When I debug the generation of the sequential select, I found out that this select statement is wrong, concerning the owing @Formula's. The generated statement contains a Formula query from a different classes; means the @Formula was defined in a different subclass. So the query throws an exception.
Debugged: SingleTableEntityPersister#generateSequentialSelect.
Has anyone an idea, what is going wrong? Is this my bug or an hibernate one?
Hibernate: 3.2.5.ga
Thanks in advance,
best regards
Michi