• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate mapping sql char to java char

 
Marek Kisiel
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello

I have a column in my mysql table: zip char(6).
I know that I can map this field as a string, but I want to use simply char type.

Exception that I am getting when I try this:

SEVERE: IllegalArgumentException in class: prenumer.beans.Adres, setter method of property: kod
2009-09-29 12:54:50 org.hibernate.property.BasicPropertyAccessor$BasicSetter set
SEVERE: expected type: [C, actual value: java.lang.Character


sourcecode (I try to use 2 setters method):



mapping:

<property name="zip" type="character" length="6"/>


Could somebody give me advice?

Regards
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic