-->
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: Primary keys with char
PostPosted: Wed Oct 22, 2003 8:23 pm 
Newbie

Joined: Mon Oct 20, 2003 12:18 pm
Posts: 12
Location: Mexico
I have some tables when the primary key are char(10) in like I have id's with property assigned (by requeriments of the system) sometimes I put keys with 7 characters or 8. But the problem is when I have to do a finder, because the querys dont return nothing. I have to put the data with blank characters to find something. This problem also occur when I have to do a load().

If someone know how can I do my querys I will be very thankful.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 22, 2003 8:51 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
The database is padding out to match the fixed width type so you will need to pad out your id names as well. A small utiltiy method will pad it out before you use it as an argument to the query to the database.


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.