Introduction

Hibernate mapppings are used as input to MD4J, with other formats possibly used in future versions (XSLT for XMI/RDFS/OWL to HBM anyone?). This page documents (well, sort of) the metadata you can use to help MD4J help you.

Class Level Reference

md4j:use-instance-projections By default, the set of projection properties in web tier actions is static. Set this to true if you want to have it created on runtime.
md4j:oncreate-or-update-code-before-business Code to be printed in generated Create/Update web-tier classes (i.e. Actions) right before business calls.
md4j:oncreate-or-update-code-after-business Code to be printed in generated Create/Update web-tier classes (i.e. Actions) right after business calls.
md4j:oncreate-code-before-business Code to be printed in generated Create web-tier classes (i.e. Actions) right before business calls.
md4j:onupdate-code-after-business Code to be printed in generated Create web-tier classes (i.e. Actions) right after business calls.
md4j:onupdate-code-before-business Code to be printed in generated Update web-tier classes (i.e. Actions) right before business calls.
md4j:oncreate-code-after-business Code to be printed in generated Update web-tier classes (i.e. Actions) right after business calls.
md4j:search-results-tabular Default is true. By setting these to false, search results for this class will be rendered using dl-based (X)HTML lists.

Member Level Reference

name parent description
md4j:date-format id, property, many-to-one The date format pattern to use for presentation and parsing given dates, default is MM/dd/yyyy. For more information on the pattern see the java.text.SimpleDateFormat documentation.
md4j:is-file id, property, many-to-one Treat the property as a File (e.g. a FormFile in Struts 1.x) in the web tier but dont do anything with it (i.e. do not persist it). See also the class-level meta: md4j:code-prebusiness
md4j:render-as-image id, property, many-to-one Treat the property as a File (e.g. a FormFile in Struts 1.x) in the web tier but dont do anything with it (i.e. do not persist it) except that also render it as one in Views.
md4j:use-value-as-key id, property, many-to-one Use the value of this property as an i18n (property) bundle key in generated views.
md4j:form-label-key id, property, many-to-one Used to generate references to i18n (property) bundle files for property labels in views. Use this or md4j:form-label.
md4j:form-label id, property, many-to-one Used to generate hardcoded labels entity property labels in views. Use this or md4j:form-label-key.
md4j:project-property many-to-one Used to point the parent object's property that should be rendered instead of it's primary key (for example in drop down lists).
md4j:collection-reverse-property collections (set, map, list bag etc) Used to link to child collections. The reverse property is essentially the property of the child object that points to the parent.
md4j:generate-finder id, property, many-to-one Will generate DAO and EJB finder methods for this property. The return type will be a Page or a single instance depending on whether the value is defined as unique or not.
md4j:onsearch-ignore-for-form id, property, many-to-one If set to true, will prevent this property from being used in search forms
md4j:onsearch-ignore-for-projections id, property, many-to-one If set to true, will prevent retreival and rendering of this property in search results
md4j:join-type many-to-one, set, bag, list, array, set Specify the join type. Valid values are FULL_JOIN, INNER_JOIN and LEFT_JOIN.