-->
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: Help nedded with Varchar2 as a Primary Key
PostPosted: Tue Jan 10, 2006 11:57 pm 
Beginner
Beginner

Joined: Mon Jan 09, 2006 8:02 am
Posts: 22
I am trying to use Varchar2 as a primary key in my Oracle table.

Loginid varchar2(10)

Now when i try and create a mapping in my XML File it reads as

<id name="Id" column="LogonId">
<generator class="native" />
</id>

My class has this defined as a string.

Now this throws an Run Time exception of "Identifier Type Mismatch".

When i change this to Number and Integer in Oracle and Class File it works perfectly Fine. Any ideas what this error could be


Regards

Prasanth


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 11, 2006 12:52 am 
Contributor
Contributor

Joined: Thu May 12, 2005 8:45 am
Posts: 226
What happens when you set the generator class to "assigned"?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 11, 2006 1:45 am 
Beginner
Beginner

Joined: Mon Oct 17, 2005 1:58 am
Posts: 27
Unless the primary case is an auto incremental numeric field you should not use generator class=native.

You should use generator class=assigned


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 11, 2006 2:49 am 
Beginner
Beginner

Joined: Mon Jan 09, 2006 8:02 am
Posts: 22
Thankz for the Help. I had some basic programming Error. Its Now solved.


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.