Book a Demo

Author Topic: Create Hibernate Mappings from model  (Read 2866 times)

McBie

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Create Hibernate Mappings from model
« on: April 09, 2008, 12:45:41 am »
Hello everybody,

I wonder if anybody tried to generate Hibernatemappings from the model with the built in transformation and generation mechanism.

Any hints are welcome! Is it doable?

Currently I'm trying to create annotations for Java but a separate xml-mapping file also would be fine.

What Im a bit struggling with are the annotations for relations.

I would imagine something like  first a transfomation where one could analyze the connectors  and create the approppriate annotation. But where should it be stored, so that in a following code generation it can be accessed and put in the appropriate place in the code file.

I saw that in the java-transformation the Attribut-name of a linkedAttribute is stored as taggedValue at the getter and settter.
But I think the linkedAttribute doesn't provide enough Information e.g. you only have the multiplicity from the other end.

Thanks!

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Create Hibernate Mappings from model
« Reply #1 on: April 09, 2008, 04:08:27 am »
I think you can do something like what you describe.

Search the forum for more hints; there have been several threads dealing with this area. Go back at least a year or two though.

Before you search the forum check the Sparx site. Look at the white papers, and any other resource pages you can find.

HTH, David
No, you can't have it!