Hi, I am using hibernate with spring. I dont want to use pojo so I am defining entity-name in hbm. following are my entries. config file . . . <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> <property name="mappingResources"> <list> <value>Rate.hbm.xml</value> </list> </property> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect">org.hibernate.dialect.H2Dialect</prop> <prop key="hibernate.connection.pool_size">10</prop> <prop key="hibernate.show_sql">true</prop> <prop key="hibernate.default_entity_mode">dynamic-map</prop> </props> </property> <property name="dataSource"> <ref bean="dataSource"/> </property> </bean> . . .
Rate.hbm.xml file is...
<hibernate-mapping> <class entity-name="Rate" table="Rate"> <id name="id" column="id"> <generator class="assigned"/> </id> <property name="name" type="string"/> <property name="createdDate" type="timestamp" column="createdDate"/> </class> </hibernate-mapping>
I am getting exception... org.hibernate.MappingException: must specify an identifier type: Rate
However if I use <class name="beans.Rate" table="Rate"> it works fine. Is there something wrong with the way I am defining entity-name.
I would appreciate if someone resolve the error.
thanks, Lico
|