-->
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: xml mapping type for character data
PostPosted: Tue Oct 30, 2007 7:12 pm 
Newbie

Joined: Mon Oct 29, 2007 12:24 pm
Posts: 10
I am trying to map to a database column that has datatype char(5). I have tried using the "character" data type in my xml map but it only brings back the first character. In other words, it treats the column as a char(1).

Anyone know what I can specify in my type attribute for this? Here is my .hbm.xml map, the id column is the column in question:

Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
        "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
        "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
    <class name="Customer" table="Customers">
   <id name="id" column="CustomerID" type="character" length="5"/>
        <property name="companyname" column="CompanyName" type="string" length="40" />
   <property name="contactname" column="ContactName" type="string" length="30" />
   <property name="contacttitle" column="ContactTitle" type="string" length="30" />
   <property name="address" column="Address" type="string" length="60" />
   <property name="city" column="City" type="string" length="15" />
   <property name="region" column="Region" type="string" length="15" />
   <property name="postalcode" column="PostalCode" type="string" length="10" />
   <property name="country" column="Country" type="string" length="15" />
   <property name="phone" column="Phone" type="string" length="24" />
   <property name="fax" column="Fax" type="string" length="24" />
    </class>
</hibernate-mapping>


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.