title: one-to-one unidirectional hibernate mapping is not creating foreign key while table creation
body: <p>anyone tell me where I am wrong. Already had wasted a day.
  Problem is why hibernate(v 3.5.0 FINAL) is not creating foreign key in cdl_group_module table? It just create table having only single column i.e id(PK). I want one-to-one unidirectional mapping. I can not use bi-directional mapping because cdl_group is also used by other tables same as for cdl_module. </p>
  
  <p>Below is my POJO. </p>
  
  <pre><code>public class CDLGroupModule extends AbstractDomainObject {
  
      /**
       * 
       */
      private static final long serialVersionUID = 1L;
  
      private Group group;
      private CDLModule cdlModule;
  
      /**
       * @return the group
       */
      public Group getGroup() {
          return group;
      }
  
      /**
       * @param group
       *            the group to set
       */
      public void setGroup(Group group) {
          this.group = group;
      }
  
      /**
       * @return the cdlModule
       */
      public CDLModule getCdlModule() {
          return cdlModule;
      }
  
      /**
       * @param cdlModule
       *            the cdlModule to set
       */
      public void setCdlModule(CDLModule cdlModule) {
          this.cdlModule = cdlModule;
      }
  
  }
  
  
  public class Group extends AbstractDomainObject{
  
      /**
       * 
       */
      private static final long serialVersionUID = 1L;
      private String name;
      private String description;
  
      public Group() {
      }
  
      public Group(String name, String description) {
          this.name = name;
          this.description = description;
      }
  
      /**
       * @return the name
       */
      public String getName() {
          return name;
      }
      /**
       * @param name the name to set
       */
      public void setName(String name) {
          this.name = name;
      }
      /**
       * @return the description
       */
      public String getDescription() {
          return description;
      }
      /**
       * @param description the description to set
       */
      public void setDescription(String description) {
          this.description = description;
      }
  
      @Override
      public String toString() {
          return "[Group : { id : " + id + ", name : " + name + ", description :" + description + " }]";
      }
  
  }
  
  
  public class CDLModule extends AbstractDomainObject {
  
      /**
       * 
       */
      private static final long serialVersionUID = 1L;
      private CdlModuleEnum module;
  
      /**
       * @return the module
       */
      public CdlModuleEnum getModule() {
          return module;
      }
  
      /**
       * @param module
       *            the module to set
       */
      public void setModule(CdlModuleEnum module) {
          this.module = module;
      }
  
  }
  </code></pre>
  
  <p>Below is my hbm.xml</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"&gt;
  &lt;hibernate-mapping package="com.qait.cdl.commons.domain"&gt;
      &lt;class name="CDLGroupModule" table="cdl_group_module"&gt;
  
          &lt;id name="id" type="long" column="id"&gt;
              &lt;generator class="native" /&gt;
          &lt;/id&gt;
  
           &lt;!-- &lt;many-to-one name="group" cascade="all" fetch="join"
              lazy="false" class="Group" not-null="true" unique="true"/&gt;
  
          &lt;many-to-one name="cdlModule" cascade="all" fetch="join"
              lazy="false" class="CDLModule" not-null="true" unique="true"/&gt; --&gt;
  
          &lt;one-to-one name="group" cascade="all-delete-orphan" fetch="join"
              lazy="false" class="Group" /&gt;
  
          &lt;one-to-one name="cdlModule" cascade="all-delete-orphan" fetch="join"
              lazy="false" class="CDLModule" /&gt;
  
  
      &lt;/class&gt;
  &lt;/hibernate-mapping&gt;
  </code></pre>
  
  <p>Hibernate created <strong>cdl_group</strong> and <strong>cdl_module</strong> table already successfully. My <strong>id</strong> property is present in <strong>AbstractDomainObject</strong> class which all POJO's are extending. If I tried <strong>many-to-one mapping using unique=true</strong> instead of <strong>one-to-one mapping</strong> than hibernate doesn't even create table.
  What is the reason behind that?
  Any kind of help will be appreciable. You can ask if you want more info from my side.  </p>