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.  [ 4 posts ] 
Author Message
 Post subject: urgent :-regarding Mapping exception and ID generator
PostPosted: Fri Mar 20, 2009 1:49 am 
Newbie

Joined: Tue Feb 24, 2009 6:52 am
Posts: 15
Dear all
i m using Hibernate 3.2.5.

i have got all mappings correct , i mean atleast it doesnt give me incorrect mapping error. I m facing problem with following exception
.
.
.
.
.
INFO: Default entity-mode: pojo
INFO: Named query checking : enabled
INFO: building session factory
INFO: Exception--->org.hibernate.MappingException: could not instantiate id generator
im a novice to hibernate
Please help me in correcting above Exception

Regards
Vikram


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 20, 2009 4:49 am 
Beginner
Beginner

Joined: Wed Nov 19, 2008 6:39 am
Posts: 44
Location: Mumbai, India
May be id value is not intialized. If you post mapping file and code then would be help for resolve this issue?

_________________
Thx,
Murugesan.
Web: http://www.murugesanpitchandi.com


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 20, 2009 5:51 am 
Newbie

Joined: Tue Feb 24, 2009 6:52 am
Posts: 15
mumbaimuru wrote:
May be id value is not intialized. If you post mapping file and code then would be help for resolve this issue?



Dear Muru
Following is the xml which when added gives me the exception

<hibernate-mapping>
<class name="clientStock" table="clientstock_tbl">
<id name="productId" type="int" column="productId" >
<generator class="foreign"/>
</id>

<property name="reorderLevel">
<column name="reorderLevel"/>
</property>
<property name="quantity">
<column name="quantity"/>
</property>
</class>
</hibernate-mapping>

Regards
Vikram


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 25, 2009 12:28 am 
Beginner
Beginner

Joined: Wed Nov 19, 2008 6:39 am
Posts: 44
Location: Mumbai, India
Opt1:
Check your Database and foreign key value is assigned to not null or not.

Opt2:
If filed is not null checked then change the mapping file to <generator class="assigned"/>

Good Luck

_________________
Thx,
Murugesan.
Web: http://www.murugesanpitchandi.com


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

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.