[jboss-user] [EJB 3.0] - Oracle problems mapping to CHAR(1) column

tvrtko do-not-reply at jboss.com
Sun Jan 21 17:29:15 EST 2007


I have a database column PARTNER_TYPE of type CHAR(1). The relevant part of entity class looks like this:

private String partnerType;
  | 
  | @Column(name = "PARTNER_TYPE", length=1)
  | //@Length(max = 1)
  | public String getPartnerType() {
  |     return partnerType;
  | }

When I run the program I get the following exception:

org.hibernate.HibernateException: Wrong column type: PARTNER_TYPE, expected: varchar2(1 char)

Then I tried:

@Column(name = "PARTNER_TYPE", length=1, columnDefinition = "CHAR(1)")

and I got

org.hibernate.HibernateException: Wrong column type: PARTNER_TYPE, expected: CHAR(1) 

Then I tried:

@Column(name = "PARTNER_TYPE", length=1, columnDefinition = "CHAR")

and I got

org.hibernate.HibernateException: Wrong column type: PARTNER_TYPE, expected: CHAR

Any idea?

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4004638#4004638

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4004638



More information about the jboss-user mailing list