facebook

Some suggestions for improvement to Hibernate tools

  1. MyEclipse IDE
  2.  > 
  3. Feature Requests
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #240571 Reply

    everbright
    Member

    Hi all,

    Have switched to using MyEclipse 4.0.3 for my Java development. It’s been a great experience so far using MyEclipse! Makes me wonder what took me so long to discover this.

    Have a few suggestions regarding how to improve the hibernate tools:

    1) The current mapping tool assumes that you would map a database table to a Java class of the same name. However, this doesn’t always work out in practice. For example, I have a table called “USERS” which stores user information. The Hibernate tool will map this to a class called “Users”, whereas a more appropriate name for the class is “User”. (As a side, I can’t rename the table as user, because “user” is a keyword in SQL Server, which is the database I’m using).
    Maybe have something in the UI for the mapping generation that allows one to specify the name of the class to map to?

    2) Seems like the mapping tool doesn’t preserve cases for the fields when mapping the Java class. For example, I had a table with the date fields “dateCreated” and “dateModified”, which actually got mapped to “datecreated” and “datemodified” in the Java class instead. This seems strange to me. Isn’t it easier to map the database field “as-is”? Or am I missing something here?

    #240629 Reply

    Riyad Kalla
    Member

    Have switched to using MyEclipse 4.0.3 for my Java development. It’s been a great experience so far using MyEclipse! Makes me wonder what took me so long to discover this.

    Thank you, we are very glad to hear it is helping you.

    1) The current mapping tool assumes that you would map a database table to a Java class of the same name. However, this doesn’t always work out in practice. For example, I have a table called “USERS” which stores user information. The Hibernate tool will map this to a class called “Users”, whereas a more appropriate name for the class is “User”. (As a side, I can’t rename the table as user, because “user” is a keyword in SQL Server, which is the database I’m using).
    Maybe have something in the UI for the mapping generation that allows one to specify the name of the class to map to?

    You are absolutely right that there is much more work to be done for the hibernate tools. Many improvements, including a new mapping generator, will be comming in the 4.1 release and the 5.0 release.

    2) Seems like the mapping tool doesn’t preserve cases for the fields when mapping the Java class. For example, I had a table with the date fields “dateCreated” and “dateModified”, which actually got mapped to “datecreated” and “datemodified” in the Java class instead. This seems strange to me. Isn’t it easier to map the database field “as-is”? Or am I missing something here?

    This is curently a bug, camel case should be honored, but currently the mapping tool honors the more universal underscore-names (date_modified, for example)

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: Some suggestions for improvement to Hibernate tools

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