-->
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: Map fixed length CHAR columns ?
PostPosted: Tue Apr 05, 2005 7:23 am 
Newbie

Joined: Tue Apr 05, 2005 7:01 am
Posts: 8
Hi all,

I'm trying to find out wether it is possible to map to fixed length SQL CHAR columns. It appears that the hibernate type "string" always maps to a VARCHAR.
As far as I understand using only fixed length fields on a table is going to make query faster as it makes it much easier to compute the offset of a record. Am I mistaken here ?

Thanks

Hibernate version:
3.0rc1
Mapping documents:

Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:

Name and version of the database you are using:
Mysql 4.1
The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 05, 2005 10:27 am 
Newbie

Joined: Tue Apr 05, 2005 7:01 am
Posts: 8
Thanks everybody, I figured it out. I can use the column tag's sql-type attribute to do this:

<column
name="myCol"
sql-type="char(40)"
/>


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.