Hi am a newbie with Hibernate version 3.1.0
i am trying to map a table dynamically to a Map
I have the following for hibernate-mapping
Code:
<hibernate-mapping>
<class entity-name="bsc" table="bsc">
<id name="code" column="bsc_code"/>
<property name="shortname" column="shortname" type="string"/>
<property name="longname" column="longname" type="string"/>
</class>
</hibernate-mapping>
i have then added this resource to the hibernate.cfg.xml
then i am running the following code
Code:
Session ds = sf.openSession().getSession(EntityMode.Map);
Map bsc=new HashMap();
bsc.put("code",new Integer(9));
bsc.put("shortname","short");
bsc.put("longname","long");
ds.save("bsc",bsc);
ds.close();
and i receive the following excveption when i run the code
Code:
org.hibernate.MappingException: Unknown Entity: bsc
Can someone please help and guide me as to what i have done wrong as essentially this is just the example from the manual.
thanks in advance