I am implementing table-per-subclass mapping and have been following the documentation but I am having the following problem and would appreciate if someone could point out the problem :
I have 4 classes BasePlan, BaseAccount, DBAccount ,DCAcoount. DBAccount and DCAccount inherit from BaseAccount. BasePlan contains a collection of accounts.(BasePlan is itself a collection in the Employee object but i dont have any problem in fetchin it)
My mappings are as follows:
<class
name="BasePlan"
table="BASE_PLAN"
>
<id
name="planId"
type="int"
column="PLAN_ID"
>
<generator class="assigned" />
</id>
<!-- bi-directional one-to-many association to BaseAccount -->
<set
name="accounts"
lazy="true"
inverse="true"
>
<key>
<column name="PLAN_ID" />
</key>
<one-to-many
class="BaseAccount"
/>
</set>
</class>
<class
name="BaseAccount"
table="BASE_ACCOUNT"
>
<id
name="accountId"
type="java.math.BigDecimal"
column="ACCOUNT_ID"
>
<generator class="assigned" />
</id>
<many-to-one name="BasePlan"
column="PLAN_ID"
class="BasePlan"/>
<joined-subclass name="DbAccount" table="DBACCOUNT">
<key column="ACCOUNT_ID"/>
<property
name="currentBalance"
type="float"
column="CURRENT_BALANCE"
/>
</joined-subclass>
<joined-subclass name="DcAccount" table="DCACCOUNT">
<key column="ACCOUNT_ID"/>
</joined-subclass>
</class>
On trying to retrieve the collection of accounts from a plan object I get
10:01:37,171 ERROR JDBCExceptionReporter:38 - could not initialize collection: [lBasePlan.accounts#1]
java.sql.SQLException: ORA-00942: table or view does not exist
The above mentioned tables do exist in the database.
TIA
splash
|