Hibernate version:
2.1.6
Mapping documents:
Code:
<class name="com.acme.Account" table="Account">
<id name="id_" column="id" type="long" unsaved-value="0" access="field">
<generator class="identity"/>
</id>
<property name="name" column="Name" type="string" not-null="true"/>
<property name="description" column="Description" type="string"/>
</class>
And Account extends IAccount which is an interface not declared anywhere in the mapping document. The intended strategy is table-per-concrete-class.
If I use session.get(IAccount.class, someId), I get the "No persister for: com.acme.IAccount" error.
However if I do
Code:
Query query = createQuery(session, "from " + IAccount.class.getName() + " as account where account.id=?");
query.setParameter(0, new Long(someId));
query.list();
I get a list containing one Account object back which is fine for me.
Why does it work in one way but not in the other?
Thanks.
--mr