facebook

Newbie: How do I add a mapping to hibernate.cfg.xml

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

    Kurt
    Member

    I see the big warning in the hibernate.cfg.xml about generated code, but how do I add a new object mapping to this file?

    I generated the ‘Item.hbm.xml’, and I’ve rebuilt the project, but I’m not sure how to regenerate this xml file.

    Thanks in advance, Kurt

    –Kurt

    #220632 Reply

    support-jeff
    Member

    Should be automatically updated for you, unless you specifically uncheck the “update config” option when creating a mapping from a table.

    jeff

    #221658 Reply

    Dave S-B
    Member

    I’m a newbie to this too – could someone detail what triggers a regeneration of the code (is it changes to the database?) and what would be a “best practice” approach to starting and maintaining an application using Hibernate. The only examples I can find seem to be very simple 1 table 1 form ones where the advantages of using code generation tools are minimal.

    #221664 Reply

    Riyad Kalla
    Member

    dave,
    The updated generation are invoked by you going back to the DB Explorer and requesting new mappings be generated when your DB structure changes. This will generate the mapping files and update the hibernate.cfg.xml file for you.

    #221902 Reply

    It would help if you also documented a procedure (even if it’s “disregard the warning and update manually”) for those who generate their mappings via XDoclet (e.g. for Hibernate.)

    Not everybody uses the database explorer. In fact, Mac OS X users are still waiting for it.

    #221903 Reply

    Greg
    Member

    @rdclark wrote:

    It would help if you also documented a procedure (even if it’s “disregard the warning and update manually”) for those who generate their mappings via XDoclet (e.g. for Hibernate.)

    We will look into documenting this procedure as you suggest. In the future, we plan on delivering more advanced Hibernate tools so that is where our documentation efforts will be focused. We certainly understand that some users will always use XDoclet that is why we will continue to support and enhance our xdoclet support in the future as well.
    @rdclark wrote:

    Not everybody uses the database explorer. In fact, Mac OS X users are still waiting for it.

    The only part of the DBexplorer that currently isn’t supported on OS X is the new ERD designer. All of the other Database Explorer features are available on the Mac platform.

Viewing 6 posts - 1 through 6 (of 6 total)
Reply To: Newbie: How do I add a mapping to hibernate.cfg.xml

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