title: Issue related hibetnate getting "org.hibernate.PropertyValueException" not-null property references a null
body: <p>I am facing problem of org.hibernate.PropertyValueException: not-null property references a null or transient value: com.master.model.AccountLoan.account.
  There are two table Accout and AccountLoan, below is table structure for Account </p>
  
  <p>Account--  </p>
  
  <pre><code>    create table ACCOUNT
      (
        ac_id               INTEGER not null,
        ac_name               VARCHAR2(40) not null,
        ac_islocked           CHAR(1) not null
      )
  </code></pre>
  
  <p>below is table structure for Account Loan</p>
  
  <p>AccountLoan--</p>
  
  <pre><code>    create table ACCOUNT_LOAN
      (
        al_id            INTEGER not null,
        al_ac_id         INTEGER not null,
        al_loanA   NUMBER(15,2),
        al_loanB   NUMBER(15,2)
        )   
  </code></pre>
  
  <p>For both table data is comming from single jsp on single add button click. Add functionality is working fine.Account loan is optional, if user do not fill LoanA and LoanB field then no record is in account loan,if user fill LoanA and LoanB field then record is insert in account loan table.</p>
  
  <p><strong>Aim</strong></p>
  
  <p>I want update account record which have not account loan.When i am updating account record following exception is throwing--
  org.hibernate.PropertyValueException: not-null property references a null or transient value: com.master.model.AccountLoan.account.</p>
  
  <p>Below is Both model java file.</p>
  
  <pre><code>import java.math.BigDecimal;
  
  public class Account extends BaseM
  {   
      private String name;            
      private Boolean isLocked;
      private AccountLoan accountLoan;
  
      public String getName()
      {
          return name;
      }
  
      public void setName(String name)
      {
        this.name = name;
      }
  
      public Boolean getIsLocked()
      {
          return isLocked;
      }
  
      public void setIsLocked(Boolean isLocked)
      {
          this.isLocked = isLocked;
      }
  
      public AccountLoan getAccountLoan()
      {
          return accountLoan;
      }
  
      public void setAccountLoan(AccountLoan accountLoan)
      {
          this.accountLoan = accountLoan;
      }
  
  }
  
  Account Loan model java file
  
  import java.math.BigDecimal;
  
  public class AccountLoan extends BaseM
  {
      private BigDecimal loanA;   
      private BigDecimal loanB;   
           private Account account;
  
      public BigDecimal getloanA()
      {
          return loanA;
      }
  
  
      public void setloanA(BigDecimal loanA)
      {
          this.loanA= loanA;
      }
  
  
      public BigDecimal getloanB()
      {
          return loanB;
      }
  
  
      public void setLoanInterest(BigDecimal loanB)
      {
          this.loanB= loanB;
      }
  
           public Account getAccount()
      {
          return account;
      }
      public void setAccount(Account account)
      {
          this.account = account;
      }
  
  }
  
  
  Account.hbm.xml
  
  &lt;hibernate-mapping&gt;
      &lt;class name="com.master.model.Account" table="ACCOUNT" dynamic-update="true"&gt;
          &lt;id name="id" column="AC_ID" type="long"&gt;
              &lt;generator class="com.common.support.IdGenerator"&gt;
                  &lt;param name="sequence"&gt;ACID_SEQ&lt;/param&gt;
              &lt;/generator&gt;
          &lt;/id&gt;                    
         &lt;one-to-one name="accountLoan" class="com.master.model.AccountLoan" cascade="all"/&gt;       
  
        &lt;property name="name" column="AC_NAME" type="string" /&gt;       
        &lt;property name="isLocked" column="AC_ISLOCKED" type="yes_no" /&gt;
  &lt;/class&gt;
  &lt;/hibernate-mapping&gt;
  
  AccountLoan.hbm.xml
  
  &lt;hibernate-mapping&gt;
  
      &lt;class name="com.master.model.AccountLoan" table="ACCOUNT_LOAN" dynamic-update="true"&gt;
          &lt;id name="id" column="AL_ID" type="long"&gt;
              &lt;generator class="com.common.support.IdGenerator"&gt;
                  &lt;param name="sequence"&gt;ALID_SEQ&lt;/param&gt;
              &lt;/generator&gt;
          &lt;/id&gt;
  
         &lt;many-to-one name="account" class="com.master.model.Account" unique="true"&gt;
             &lt;column name="AL_AC_ID" not-null="true" /&gt;
         &lt;/many-to-one&gt;    
  
         &lt;property name="loanA" column="AL_LOANA" type="big_decimal" /&gt; 
         &lt;property name="loanB" column="AL_LOANB" type="big_decimal" /&gt;
  
      &lt;/class&gt;
  &lt;/hibernate-mapping&gt;
  </code></pre>