facebook

Additional Hibernate functionality

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

    peterwontner
    Member

    Firstly I want to apologise if any of the suggestions made below are current functionality and I have not found how to use it!

    I would like to see the following things added to the Hibernate plugin…

    1) Ability to specify a seperate location for mapping files & generated java code when using the Mapping wizard from DB Explorer. I don’t thik it is the normal case that the mapping files will exist in the same package as the generated java source.

    2) Some sort of either manual or auto synchronisation feature to keep mappings & source in step (I think HibernateSynch does this)

    3) Ability to turn off the creation of the derived class from the Abstract 6) class. I am using Hibernate with a legacy system, where we already have db tables and business objects. I want to use the generated Hibernate classes as base classes to the existing classes.

    4) Better generation of java code & mapping files. Currently the mapping files do not contain the set, list, bag, etc definitions for one to many, many to many, etc. These have to be hand coded in both the mapping file and the generated source.

    5) Better XDoclet support in the generated java source.

    6) Some sort of wizard to facilitate the creation of HQL queries for insert into the mapping file(s)

    7) Ability to select mapping file(s) from the Navigator and add them to the configuration file (preferably without wiping out the connection information;)

    8) Hibernate file awareness for project Navigator filters. Currently you have to clear the checkbox for non-java elements to get the mapping files to appear, which also results in other things showing up.

    All these features would help me and I am sure anyone else who has to migrate legacy systems to Hibernate based architecture, as well as maintain a Hibernate based system.

    Lastly, many thanks for a fantastic tool to work with, hope you keep up the good work.

    #213466 Reply

    Riyad Kalla
    Member

    I have asked the hibnerate dev to look at this.

    #213521 Reply

    support-jeff
    Member

    peter –

    Thanx for the excellent feedback; its always nice to have a user that cares enuf to suggest better ways to do things! I will add all of these as enhancement requests and we will see what we can do.

    Some comments:
    #1 – I have annecdotal evidence that it is pretty common practice to do so. But there is no reason that we cannot support any location, as long as it is classpath-relative.

    #3 – we do the base class vs concrete class thing so that you can customize and the plugin can sync upon regenerating from DB w/o whacking your customizations. Sure we could make it configurable, but what stops you from doing it your way now? (other than that the mapping file needs to be manually updated to point to your subclass?)

    #5 – don’d hold your breath on this one; xdoclet is losing favor in ME. But it is easy enuf to add it to the Velocity templates yourself if you so desire

    Could you elaborate on #6 a bit more – I think I follow you, but would like to be sure. We are talking about filters, correct?

    #8 sounds like a config issue for you. Out of the box, I have no problem seeing xml files in the navigator. Are you talking about the .myhibernatedata file? If so, you should not want to see that (much less muck around with it!)

    #213524 Reply

    snpe
    Member

    1) mapping file and java file are default in same directory package –
    They can be in different package but it is suggestion from hibernate team
    Hibernate suppose sometimes that they are in same package and it is easer for development

    see CaveatEmptor example application from caveatemptor.hibernate.org

    2) It isn’t important for me – ME or tools do only first step and there is too more posibilites that tools do good work hier

    3) I agree – I think that tools make only plain POJO class

    4) I agree – types from databases are bad , too

    5) agree – it is important, but in hibernate3 will be annotation

    6) it is better tools like objectvisualiser from opensourcesoft.net

    7) it isn’t important for me

    8) not important for me

    regards
    regards

    #213528 Reply

    peterwontner
    Member

    thanks for spending the time to look at these and comment.
    to add a bit more info for 6)…
    Hibernate supports the notion of declaring HQL (or SQL) queries within a mapping file, identifying them by name. These queries can then be used from code by referencing the query by the query name. This mechanism ensures we do not have to hard code queries into the application. So a feature that I would find useful is a wizard that is HQL / SQL syntax aware that helped create the query and inserts it into the selected mapping file. This mechanism could help ensure the HQL / SQL syntax is correct.

    On point 2), I expected that the ME development team would have preferred we use the tools provided within ME to perform Hibernate operations. It seems that snpe is suggesting that we also use other plug-ins to do some of the work. Did I mis-understand what he is saying? If the expectation is that we ALSO use other plugins to maintain Hibernate projects, do you have a recomendation as which is the best to use?

    #213543 Reply

    snpe
    Member

    6) I know for two tools for research HQL : hibern8ide and objectvisualiser
    They isn’t eclispe plugins, tey are swing applications

    It is example usage, only

    regards

    #215171 Reply

    danpfe
    Member

    I also have some feature requests which are essential for us to make the Hibernate implementation a usable tool.

    1.) You should be able to specify a pattern how mapped classes should be named. For example: All our transport classes have the ending “Transport”. Meaning that the table CUSTOMER would have a transport named CustomerTransport. This would be excellent since refactoring the class name after the Hibernate tool has created the file just doesn’t feel right.

    2.) When you export a table to a hibernate mapping the plugin always creates “references” where foreign keys exist even though I didn’t map the table linked to by the foreign key exists as a mapping in my project. This creates a huge amount of additional work since we have a very large database.

    3.) Although the Hibernate Wizard asks for a Base class it really isn’t that smart and actually checks the baseclass. In our base class we already implement Serializable, but the Abstractxxxx.java file created by the plugin implements serializable again. Not that it’s a huge problem but why does it ask for the base class in the first place?

    4.) Since our database is quite large I do not always want to have all columns in a table mapped and would very much like that the “Export to mapping”-wizard asks me which columns I’d like to have in the mapping file.

    Additionally, I totally agree on number 3 and 6, I’m missing these two features as well, even though I very well understand the point behind creating Abstract implementations.

    Thanks!
    /Daniel

    #227969 Reply

    David Brooks
    Member

    Yes, I’m also wondering what to do about #6.

    One nice way to handle it might be for ME to recognize instances of ‘getNamedQuery’ in java files, and provide a popup wizard (possibly from a right click menu) for defining the underlying query. The wizard would then add it to the appropriate config file.

Viewing 8 posts - 1 through 8 (of 8 total)
Reply To: Additional Hibernate functionality

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