title: Null value was assigned to a property of primitive type while hibernate query execution?
body: <p>i have below code snippet in dao     </p>
  
  <pre><code> String GET_CUSTOMER="SELECT * from customer where custName=:custName"
    Session session = getHibernateUtil().getSession();
    SQLQuery query = session.createSQLQuery(GET_CUSTOMER);
  
      query.setParameter("custName", custName);
      query.setResultTransformer(Transformers
          .aliasToBean(Customer.class));
  
      Customer custData = (Customer) query
          .uniqueResult();//line
  </code></pre>
  
  <p>Customer table  has some int columns for which  some values as null. Now at line1 i get error
  Null value was assigned to a property of primitive type setter of Customer.Address</p>
  
  <p>Is there a way in hibernate/query/Transformer to convert the null values to 0 automatically?
  I have just mentioned one table i.e customer but there are various joined table which contains int value as null in various columns so i do
  not want to handle in query for each table.</p>
  
  <p><strong>UPDATE:-</strong> Customer is not Hibernate entity. It pojo with instance fields of int type</p>