-- $Id$ -- Generates a test hibernate mapping 3.0 model from a uml2 model module GenerateHibernateMapping; create OUT : HBM from IN : UML2; rule HibernateMapping { from s : UML2!Model to hm : HBM!HibernateMappingType mapsTo s ( class <- UML2!Class->allInstances()), dr : HBM!DocumentRoot ( hibernateMapping <- hm) } rule Class { from s : UML2!Class to c : HBM!ClassType mapsTo s ( name <- s.name, table <- s.name->toUpper(), id <- id), id : HBM!IdType ( name <- 'id', column1 <- s.name->toUpper() + '_ID', generator <- gen), gen : HBM!GeneratorType ( class <- 'native', param <- Sequence{par}), xmltype : HBM!XMLTypeDocumentRoot ( text <- Sequence{'xxx'}), par : HBM!ParamType ( name <- 'test', mixed <- xmltype.mixed) }