Hello every one!! I am new to Hibernate and i need the following:
i have created a stored procedure that through multi innerjoins creates a temp table which returns 23 values (Field 1 -.. Field23). i have followed the previous example shown here:
https://forum.hibernate.org/viewtopic.php?p=2248512 but i still have trouble with the mapping.
Since there is no real table (reportE6) in the database i do the following:
the xml file:
Code:
<hibernate-mapping>
<class name="reportE6">
<id name="field1" type="string" />
<property name="field2" type="string" not-null="true"/>
<property name="field3" type="string" not-null="true"/>
<property name="field4" type="string" not-null="true"/>
<property name="field5" type="string" not-null="true"/>
<property name="field6" type="string" not-null="true"/>
<property name="field7" type="string" not-null="true"/>
<property name="field8" type="string" not-null="true"/>
<property name="field9" type="string" not-null="true"/>
<property name="field10" type="string" not-null="true"/>
<property name="field11" type="string" not-null="true"/>
<property name="field12" type="string" not-null="true"/>
<property name="field13" type="string" not-null="true"/>
<property name="field14" type="string" not-null="true"/>
<property name="field15" type="string" not-null="true"/>
<property name="field16" type="string" not-null="true"/>
<property name="field17" type="string" not-null="true"/>
<property name="field18" type="string" not-null="true"/>
<property name="field19" type="string" not-null="true"/>
<property name="field20" type="string" not-null="true"/>
<property name="field21" type="string" not-null="true"/>
<property name="field22" type="string" not-null="true"/>
<property name="field23" type="string" not-null="true"/>
<loader query-ref="reportE6_SP"/>
</class>
<sql-query name="reportE6_SP" callable="true">
<return class="reportE6">
<return-property name="field1" column="field1"/>
<return-property name="field2" column="field2"/>
<return-property name="field3" column="field3"/>
<return-property name="field4" column="field4"/>
<return-property name="field5" column="field5"/>
<return-property name="field6" column="field6"/>
<return-property name="field7" column="field7"/>
<return-property name="field8" column="field8"/>
<return-property name="field9" column="field9"/>
<return-property name="field10" column="field10"/>
<return-property name="field11" column="field11"/>
<return-property name="field12" column="field12"/>
<return-property name="field13" column="field13"/>
<return-property name="field14" column="field14"/>
<return-property name="field15" column="field15"/>
<return-property name="field16" column="field16"/>
<return-property name="field17" column="field17"/>
<return-property name="field18" column="field18"/>
<return-property name="field19" column="field19"/>
<return-property name="field20" column="field20"/>
<return-property name="field21" column="field21"/>
<return-property name="field22" column="field22"/>
<return-property name="field23" column="field23"/>
</return>
{ call reportE6_SP }
</sql-query>
</hibernate-mapping>
There is also a reportE6.java file with all the needed variable declarations.
i keep getting the error "SEVERE: Error in named query: reportE6_SP - org.hibernate.MappingException: Unknown entity: reportE6"
Any ideas?