-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Mapping Exception....entity-name issue
PostPosted: Tue Jul 28, 2009 11:52 pm 
Newbie

Joined: Thu Jul 16, 2009 7:14 pm
Posts: 2
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.