JBoss Community

Configure Field-length for Hibernate Reverse Engineering

created by Norman Schulze in JBoss Tools Development - View the full discussion



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.



Reply to this message by going to Community

Start a new discussion in JBoss Tools Development at Community