facebook

Hibernate wizard example?

  1. MyEclipse Archived
  2.  > 
  3. Documentation
Viewing 5 posts - 16 through 20 (of 20 total)
  • Author
    Posts
  • #214565 Reply

    support-jeff
    Member

    snpe –

    Yep, understood. My point was just that the ME Hibernate tool does not use xdoclet to do the mapping and java class generation – custom Velocity templates are. If you choose to add xdoclet tags to your source code with which to generate mapping files, you are on your own – these will get overwritten by the ME tool if you ever choose to re-generate mappings and the abstract base classes.

    #214566 Reply

    snpe
    Member

    But, You can set xdoclet tags when generate java code from mapping files

    #214567 Reply

    tarantula
    Participant

    Ok. The generated Hibernate XML files clearly say “do not edit” because changes would be wiped out during synchronization. I see that the hibernate.cfg.xml file is synchronized each time you export a table, but when does synchronization happen for the *.hbm.xml mapping files? Is it only the first time or can I sync them up again with my base classes later on? It would be great to have round-trip engineering here where I could right-click on a mapping file and go “Hibernate->Synchronize” to keep the xml in sync with the Java code and vice versa.

    My question is, sometimes the resulting files still need some modification to get the column types and entity-relational mappings right so I would like to find a way to update these files without having my changes wiped out. Can I provide my own custom Velocity templates (eg. for application or database-specific settings) or can I modify the existing ones? If so, a tutorial would be handy.

    #214636 Reply

    support-jeff
    Member

    * hibernate.cfg,xml – synchronized when you create mapping files
    * mapping files – not synchronized at this time; (re)generated at direction of the user from tables thru DB Explorer (hence the warning – any manual changes in the files will be lost)
    * abstract base class – not sync’d at this time; (re)generated at direction of the user when mapping files created (hence the warning here too)
    * subclass – only created once, the first time a mapping is created for the table – therefore safe to modify

    Synchronization and customized mappings are in the future – ME 3.9 and beyond.

    #214651 Reply

    tarantula
    Participant

    jeff,

    Thank you. The tool is working great for me now. I’m looking forward to the new features. Keep up the fine work!

    tarantula

Viewing 5 posts - 16 through 20 (of 20 total)
Reply To: Hibernate wizard example?

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