Announcement Announcement Module
No announcement yet.
DBRE version column data type mismatch Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • DBRE version column data type mismatch

    Hi All,
    I have inherited a database ( postgres ) with a .Net application and we have to migrate the application to Spring. The .Net application was developed with nHibernate. We cant change the DB schema.

    In the database, each table has a id ( integer ) primary key and a version ( smallint ) column. When we attempt to run the code generated by Roo DBRE + web mvc , we are getting the following error :

    org.hibernate.HibernateException: Wrong column type in public.dbobject for column version. Found: int2, expected: int4

    The version column which is of type smallint in the database, is mapped by DBRE to a Integer in Dbobject_Roo_Jpa_Entity.aj like shown below :

    @Column(name = "version")
    private Integer Dbobject.version;

    1) I thik this is what's causing the "Found: int2, expected: int4" error, right?
    2) How do we get DBRE to create version as Short instead of Integer?
    3) Overall what is the best way of resolving this problem?

    Thanks in advance..