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.  [ 2 posts ] 
Author Message
 Post subject: Id Type Mismatch on a regular id / long type !?
PostPosted: Thu Jan 25, 2007 12:29 pm 
Regular
Regular

Joined: Fri Feb 03, 2006 5:28 pm
Posts: 73
Location: Québec, QC, Canada
Here is how I retreive a member from my db:
membre = (Membre)session.Load(typeof(Membre), myid);

where myid is of type long.

in the mysql, I use int as the db column type.
and I use native as the id type in the mapping files.

I use nhibernate 1.2.0

The thing is.. I get a type mismatch error:
identifier type mismatch
Parameter name: id
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentException: identifier type mismatch
Parameter name: id

Source Error:

Line 30: {
Line 31: session = NHibernateFactory.GetSession();
Line 32: membre = (Membre)session.Load(typeof(Membre), myid);
Line 33: }
Line 34: catch (HibernateException ex)


Any idea why?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 26, 2007 8:53 pm 
Newbie

Joined: Fri Jan 05, 2007 5:36 am
Posts: 16
I have the same problem but I use SQL Server Express.
I have tried to change the datatype to Int64 in the mapping file, the entity class and in the database but it doesn't work.

I can retrieve an IList of the object and also Save the object to the database without any problem.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.