Hi there, I have tried to insert a record in a table which is an in-between-table with the foreign keys, that are also the primary keys.
I got the following error message.
org.springframework.orm.hibernate.HibernateSystemException: The class
has no identifier property: eu.cec.immogest.realestate.TbReaInvestmnt;
nested exception is net.sf.hibernate.HibernateException: The class has
no identifier property: eu.cec.immogest.realestate.TbReaInvestmnt
net.sf.hibernate.HibernateException: The class has no identifier property: eu.cec.immogest.realestate.TbReaInvestmnt
at
net.sf.hibernate.persister.AbstractEntityPersister.getIdentifier(Abstr
actEntityPersister.java:314)
I have introduced in the TbReaInvestmnt.hbm.xml the following properties but it does not help.
<hibernate-mapping package="eu.cec.immogest.realestate">
<class
name="TbReaInvestmnt"
table="TB_REA_INVESTMNT">
<composite-id class="TbReaInvestmnt">
<key-many-to-one
name="realestate"
class="TbRealEstate"
column="REAL_ESTATE_ID"
/>
<key-many-to-one
name="investment"
class="TbInvestment"
column="INVESTMENT_ID"
/>
</composite-id>
<property
name="realestateId"
column="REAL_ESTATE_ID"
type="integer"
not-null="true"
insert="false"
update="false"
length="22"/>
<property
name="investmentId"
column="INVESTMENT_ID"
type="integer"
not-null="true"
insert="false"
update="false"
length="22"/>
</class>
</hibernate-mapping>
here is the code that is calling the corresponding DAO class.
tbReaInvestmntDAO.save(tbReaInvestmnt);
Could somebody try to help me understanding what's going wrong?
Thank you.
|