1 Reply Latest reply on Sep 9, 2008 3:56 AM by David Rosell

    Oracle problems mapping to CHAR(1) column

    Tvrtko S Newbie

      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?