facebook

How to control Hibernate mapping?

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

    THE99999
    Member

    I am using MyEclipse 4.0.0 with Java 1.5 and Eclipse 3.1, MySQL 5.0 (InnoDb).
    Creating simple Hibernate applications is easy, all works fine.
    However the questions begin where the manual ends:
    First question:
    The totorial states, the it focuses on “forward engineering”, which obviously means starting with the (given) DB tables and generating the getter/setter class and the mapping file from it. Is this just the focus of the tutorial or is it the only way currently supported by MyEclipse? Can I also start with a java bean and generate the DB table + mapping from it? How?
    Second question (more important):
    How can I instruct MyEclipse, how to create more complex mappings with interrelated tables? Where does MyEclipse get the required input from (Constraints in the DB, XDoclet tags, some naming convention, separate file?)
    If this is covered in a document, please give me a link. The “getting started” tutorial shows quite nicely, that the integration works, but then I spent quite some time figuring out, how it works and how far it goes. Some hints would be very helpful. If it’s not yet done – well it’s not yet done. But it is kind of awkward for me to search in the dark for a black cat, that may not even be there at all…
    Thank you in advance.
    Thomas

    #240484 Reply

    Riyad Kalla
    Member

    First question:
    The totorial states, the it focuses on “forward engineering”, which obviously means starting with the (given) DB tables and generating the getter/setter class and the mapping file from it. Is this just the focus of the tutorial or is it the only way currently supported by MyEclipse? Can I also start with a java bean and generate the DB table + mapping from it? How?

    This is the only method supported currently.

    Second question (more important):
    How can I instruct MyEclipse, how to create more complex mappings with interrelated tables? Where does MyEclipse get the required input from (Constraints in the DB, XDoclet tags, some naming convention, separate file?)

    MyEclipse will pickup the foreign key mappings and such and generate appropriate relationships in the hbm.xml files.

    Thomas, we also have quite a bit of enhancements comming in the 4.1 and 5.0 releases for our Hibernate tools.

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: How to control Hibernate mapping?

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