Hello ,
I have query which is join between some tables. When I am running it as a regular SQL query I am getting my Object[] without problems, but when ever I am trying to addEntity to return Object I am getting NullPointerException during query.list();
Mappings
<typedef name="play_type" class="orm.hibernate.GenericEnumUserType">
<param name="enumClass">myprojects.domain.PlayType</param>
<param name="identifierMethod">getId</param>
<param name="valueOfMethod">fromId</param>
</typedef>
<subclass name="PlayGround"
extends="MasterGround"
discriminator-value="1">
<join table="PLAY">
<key column="PLAY_ID" unique="true" />
<property name="title"
column="PLAY_TITLE"
/>
<property name="text"
column="PLAY_TEXT"
/>
<property name="pros"
column="PLAY_TEXT"
/>
<property name="cons"
column="PLAY_CONS_TEXT"
/>
<property name="rating"
column="PLAY_RATING"
/>
<property name="playType"
column="PLAY_TYPE_ID"
not-null="true"
type="play_type"
/>
</join>
</subclass>
==========
Query is
SELECT
{play.*}, {rt.*},
FROM play play
JOIN PLAY_TYPE pt
ON play.PLAY_TYPE_ID=pt.PLAY_TYPE_ID
...
WHERE play.play_id= :playid
before calling list() on query I am doing
query.addEntity("play", PlayGround.class).addJoin("pt", "play.playType");
after execution I am getting NullPointerException with out any details
|