0 Replies Latest reply on Aug 13, 2013 9:08 AM by nosc82

    Configure Field-length for Hibernate Reverse Engineering

    nosc82

      Hi,

       

      I'm using Hibernate Tools for generating POJOs of my Oracle Database. Generally, you can configure the behavior for the reverse engeneering process in the file 'hibernate.reveng.xml'. But it's not possible to configure the length of a VARCHAR column.

       

      I need this, because I created a column with: create table table_name(column_name varchar2(50 char)). The resulting length in the database is 200 bytes, because the database is using UTF-8 encoding. One character needs between 1 to 4 bytes.

       

      The generated POJO-class is annotated with

      @Column(name="COLUMN_NAME", length=200)

          public String getColumnName() {

              return this.columnName;

          }

       

      Is there an opportunity for adjusting the resullting length? If not, it would be nice to have the option to configure this. Although writing my own ReverseEngineeringStrategy wasn't successfull.

       

      Thanks.