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>