Hi all,
I 've got a problem trying to create a table per concrete class inheritance using annotation.
The generated sql for each concrete class does not use the table defined in the superclass (@Table). The class hierarchy is simple. RequestInboxItem is the superclass and has TradeRequestInboxItem as a subclass. Finally the V_REQUEST_INBOX is a view
Do you have any idea of what I am doing wrong? All details are included below
Regards,
Kostas
Hibernate version:
3.2.6ga
Mapped classes:
Code:
@Entity
@Proxy(lazy=false)
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@Table(name = "V_REQUEST_INBOX")
@DiscriminatorColumn(name = "REQUEST_TYPE_ID", discriminatorType = DiscriminatorType.INTEGER)
public abstract class RequestInboxItem extends Request{
}
@Entity
@Proxy(lazy=false)
@DiscriminatorValue("0")
public class TradeRequestInboxItem extends RequestInboxItem{
}
Full stack trace of any exception that occurs (in hibernate tools log console):2008-05-27 16:31:57,673 WARN Main Thread org.hibernate.util.JDBCExceptionReporter - SQL Error: 942, SQLState: 42000
2008-05-27 16:31:57,673 ERROR Main Thread org.hibernate.util.JDBCExceptionReporter - ORA-00942: table or view does not exist
Name and version of the database you are using:Oracle
The generated SQL (show_sql=true):Code:
0: com.[omitted].TradeRequestInboxItem
-----------------
select
tradereque0_.REQUEST_ID as REQUEST1_156_,
tradereque0_.COUNTRY_ISO_CODE as COUNTRY2_156_,
tradereque0_.CREATED_TIMESTAMP as CREATED3_156_,
tradereque0_.REQUEST_TYPE_ID as REQUEST7_156_,
tradereque0_.REQUEST_STATUS_ID as REQUEST8_156_,
tradereque0_.STATUS_NOTE as STATUS4_156_,
tradereque0_.UPDATED_BY_COFF as UPDATED5_156_,
tradereque0_.UPDATED_TIMESTAMP as UPDATED6_156_
from
TradeRequestInboxItem tradereque0_brokeracco0_