HIBERNATE JBoss.org
 |  Register  | 
     
News 
About 
   Feature List 
   Road Map 
Documentation 
   Related Projects 
   External Documentation 
Download 
Forum & Mailinglists 
Support & Training 
JIRA Issue Tracking
Wiki Community Area


Hibernate Public Training Courses


Get Hibernate in Action eBook!


JavaWorld 2003 Finalist


Jolt Award 2004 Winner
      
Documentation > Community Area > AndroMDA hbm Cartridge

AndroMDA hbm Cartridge

Document content: this is a simple, experimental cartridge for Andromda to directly generate hbm mappings for hibernate 2. It is far from complete but I find it quite usefull.

Warning: experimental

Links:

- full document

- contact me: Marilen Corciovei

- Hibernate(the DB persistence)

- AndroMDA

- Nemesis IT (my company)

Download: download the cartridge

Model tagging

  • PrimaryKey: stereotype for an attribute tagging it a the primary key
  • SQLType: taggedValue for an attribute generating an optional hibernate sql-type = ...
  • NotNull: taggedValue marking an attribute as not null
  • seq: optional per table sequence name. Results in a:
    <generator class="${generator}">
            <param name="sequence">$seq</param>
    </generator>
  • build.xml user properties*
  • generator: sequence generator type
  • tableprefix: table prefix for generated tables
  • build.xml integration*
    <target name="hbm" depends="init">
        <taskdef name="andromda"
            classname="org.andromda.core.anttasks.AndroMDAGenTask"
            classpathref="build.class.path"
            />

        <unzip src="uml/service.zargo" dest="build/model/unzipped" />

        <andromda basedir="build/model/unzipped"
            includes="service.xmi"
            lastModifiedCheck="false"
            typeMappings="${umlgen.dir}/TypeMapping.xml"
            >
            <userProperty name="generator" value="native" />
            <userProperty name="tableprefix" value="NITSERVICE" />

            <outlet cartridge="hbm" outlet="entities" dir="${src.dir}" />
        </andromda>
    </target>
      

coWiki