title: entity mapping: convert from hbm.xml to orm.xml, missing fields and attributes
body: <p>I´m new to hibernate and I must convert the Entity Mapping in an application from hbm.xml to orm.xml. My Problem is that I am missing some fields and attributes to convert correctly.</p>
  
  <p>this is the hbm.xml which I´m trying to convert:</p>
  
  <pre><code>&lt;hibernate-mapping package="server.model.history"&gt;
  
      &lt;typedef name="outputType" class="org.hibernate.type.EnumType"&gt;
          &lt;param name="enumClass"&gt;server.model.history.OutputType&lt;/param&gt;
          &lt;!-- Hibernate type '4' means Integer --&gt;
          &lt;param name="type"&gt;4&lt;/param&gt;
      &lt;/typedef&gt;
  
      &lt;class name="ProcessOutput" table="PROCESS_OUTPUT" mutable="false"&gt;
  
          &lt;id name="id" column="ID" type="server.model.id.hibernate.ProcessOutputIdUserType" access="field"&gt;
              &lt;generator class="info.novatec.np.server.model.id.hibernate.CustomGenerator" /&gt;
          &lt;/id&gt; 
  
          &lt;discriminator column="HOST_KIND" type="string"/&gt;
  
          &lt;version name="version"
                   access="field" 
                   column="VERSION" 
                   type="integer"/&gt;
  
          &lt;property name="sequence" column="SEQUENCE" type="integer" not-null="true" unique-key="UNIQUE_SEQUENCE_CREATED_PROCESSID" access="field"/&gt;
  
          &lt;list name="variables" table="HOST_VARIABLE" cascade="all"&gt;
              &lt;key column="FK_HOST_ID"/&gt;
              &lt;list-index column="INDEX" /&gt;
              &lt;composite-element class="server.model.SimpleKeyValuePair"&gt;
                  &lt;property name="key" access="field" column="KEY" type="string" not-null="true" /&gt;
                  &lt;property name="value" access="field" column="VALUE" type="string"/&gt;
              &lt;/composite-element&gt;
          &lt;/list&gt;
  
          &lt;many-to-one name="process" class="ProcessStep" column="FK_PROCESS_ID" not-null="true" unique-key="UNIQUE_SEQUENCE_CREATED_PROCESSID" access="field" index="OUTPUT_FOREIGNKEY_INDEX" /&gt;
  
      &lt;/class&gt;
  &lt;/hibernate-mapping&gt;
  </code></pre>
  
  <p>and here is how I convert it to orm.xml so far:</p>
  
  <pre><code>&lt;entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_1_0.xsd"
      version="1.0"&gt;
  
      &lt;package&gt;info.novatec.np.server.model.history&lt;/package&gt;
  
      &lt;entity class="ProcessOutput"&gt;
          &lt;table name="PROCESS_OUTPUT" /&gt;
  
          &lt;attributes&gt;
              &lt;id name="id"&gt; 
                  &lt;column name="ID" /&gt;
              &lt;/id&gt;
  
         &lt;version name="version" &gt;&lt;column name="VERSION"/&gt;&lt;/version&gt;
  
              &lt;basic name="sequence"&gt;
                  &lt;column name="SEQUENCE" nullable="false"/&gt;
              &lt;/basic&gt;
  
              &lt;many-to-one name="process" &gt;&lt;/many-to-one&gt;
  
          &lt;/attributes&gt;
      &lt;/entity&gt;
  &lt;/entity-mappings&gt;
  </code></pre>
  
  <p>as you can see it is incomplete, scrappy and partly incorrect.
  How can I write the id_type id_access and generator class in the orm.xml??</p>
  
  <p>I also didn´t find nothing equivalent to property unique-key, type and many-to-one index
  and what about the discriminator and typedef name="..." class="..." param.../> .../>??</p>
  
  <p>I would be thankful and It would be great for any help.</p>