• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Hibernate mapping oracle char

 
Ranch Hand
Posts: 198
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I have db field of type char(4).
I use hibernate to get this particular field .
The type specified in hibernate file is as below

<property name="abc" type="string">
<column name="abc" length="4" />
</property>


I also tried giving sql-type=char(4).
I used createSQLQuery method of hibernate session to get this value .
But I get only the first character of the field value.
Can anybody suggest why?

Thanks
Ajai
 
Ranch Hand
Posts: 161
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
does the Java bean that you map to define the property 'abc' as a java String?

The Java char primative, or java.lang.Character class still only old one character.

I found that char(s) in the datbase map to java.lang.String, or "text" types in hibernate.
 
reply
    Bookmark Topic Watch Topic
  • New Topic