facebook

Hibernate Rev.Engg – DB Column names cross db compatibility

  1. MyEclipse Archived
  2.  > 
  3. Database Tools (DB Explorer, Hibernate, etc.)
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #311113 Reply

    Srinivasa Ragavan
    Participant

    MyEclipse version 8.0
    Build id: 8.0-20091120
    Hibernate 3.2

    I have created reverse engineering POJOs including DAOs for MySQL Database tables.
    When I have my custom code with HQL select refering generated POJOs, it works fine for MySQL database in which rev.engg done.
    ( I cannot use default findbyproperty method which comes with rev.engg due to multiple where condition columns).

    I am trying to execute same application connecting to Oracle 10g database, the same HQL statements are not working because Hibernate is throwing SQLGrammerException due to case sensitivity of column names generated in MySQL not compatible with Oracle.

    On observation, column name for example CUSTOMERNAME (uppercase in both oracle and mysql), has been generated as ‘CustomerName’ in mapping file when generated with MySQL. But same column has been generated as ‘customername’ when connected and generated with Oracle.

    Due to this, my custom HQL is not working during runtime.

    Is there any method to specifiy in reverse engineering process, to make the generation of column names compatible with all databases, atleast with mysql and oracle database.

    Or is it a limitation of hibernate.

    Please suggest

    -Rags

    #311135 Reply

    Rags,

    On observation, column name for example CUSTOMERNAME (uppercase in both oracle and mysql), has been generated as ‘CustomerName’ in mapping file when generated with MySQL. But same column has been generated as ‘customername’ when connected and generated with Oracle.

    I could not replicate this at my end using ME8.6. The column names generated in both the cases are in lowercase.
    Can you upgrade to 8.6 and check if the issue persists?

    Is there any method to specifiy in reverse engineering process, to make the generation of column names compatible with all databases, atleast with mysql and oracle database.

    You can try using the custom reverse engineering strategy as given in the link below –
    http://www.myeclipseide.com/documentation/quickstarts/hibernate/#5-6
    Let me know if that helps

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: Hibernate Rev.Engg – DB Column names cross db compatibility

You must be logged in to post in the forum log in