-->
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.  [ 1 post ] 
Author Message
 Post subject: schemaupdate create table: unable to fix id to char(32)
PostPosted: Wed Apr 07, 2004 11:36 pm 
Newbie

Joined: Tue Jan 06, 2004 8:06 am
Posts: 13
Hi all

We are trying to fix the ID field to char(32) instead of varchar(32). Table creation is done via SchemaUpdate and we are using MySQL.


------------------------------------------------------------------------------
This mapping,

<hibernate-mapping>
<class name="foo" table="FOO">
<id name="id">
<column name="ID" sql-type="char(32)" not-null="true"/>
<generator class="assigned"/>
</id>

<property name="content">
<column name="CONTENT" sql-type="varchar(255)"/>
</property>
</class>
</hibernate-mapping>


generates
FOO {
ID varchar(32),
CONTENT varchar(255)
}

Even if I have specifically asked for char(32).

------------------------------------------------------------------------------
However, by fixing the content type to char(255),

<hibernate-mapping>
<class name="foo" table="FOO">
<id name="id">
<column name="ID" sql-type="char(32)" not-null="true"/>
<generator class="assigned"/>
</id>

<property name="content">
<column name="CONTENT" sql-type="char(255)"/>
</property>
</class>
</hibernate-mapping>

I am able to generate table as
FOO {
ID char(32),
CONTENT char(255)
}

But we need content to be of type varchar.


In other words, SchemaUpdate will not create the id type as char() if there are other varchar() fields present. Is this understanding correct?

Cheers
-Wee King-


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

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.