title: Not-null property references a transient value transient instance must be saved before current operation
body: <p>i am having the table <code>product</code> in that table one of the foreign key <code>dimension_id</code>. so while writing my test case in service layer it shows the error.
   this is my test case </p>
  
  <pre><code>@Transactional(propagation = Propagation.REQUIRED)
      private ProductBO getProductBO() {
          SellerBO sellerBO = getSellerBO();
          ProductBO productBO = new ProductBO();
          productBO.setCategoryId(1);
          productBO.setDateAvailable("20/00/0000");
          productBO.setImage("a15cb5e");
          productBO.setLocation("for getting product details");
          productBO.setMinimum(26.00);
          productBO.setModel("service");
          productBO.setPoints(5);
          productBO.setPrice(12.2f);
          productBO.setQuantity("2");
          productBO.setSellerBO(sellerBO);
          productBO.setShipping(2);
          productBO.setSku("aqaqaq");
          productBO.setSortOrder("aes");
          productBO.setStatus(1);
          productBO.setStockStatusId("20");
          productBO.setProductName("Micromax");
          productBO.setSubtract(20.0001);
          productBO.setUpc("asd");
          productBO.setViewed(2);
          productBO.setWeight("25");
          productBO.setWeightClassBO(getWeightClassBO(productBO));
          productBO.setDimensionBO(getDimension());
          return productBO;
      }
  
  
  public DimensionBO getDimension() {
          DimensionBO dimensionBO = new DimensionBO();
          dimensionBO.setHeight(12);
          dimensionBO.setLength(23);
          dimensionBO.setWidth(14);
          dimensionBO.setLengthClassBO(getLengthClass());
          try {
              manageDimensionServiceImpl.addDimension(dimensionBO);
          } catch (CrafartServiceException csExp) {
              csExp.printStackTrace();
              Assert.fail();
          }
  
          return dimensionBO;
  
      }
  </code></pre>
  
  <p>this is my  dimensionimpl</p>
  
  <pre><code>@Override
      @Transactional(propagation = Propagation.REQUIRED)
      public void addDimension(DimensionBO dimensionBO) throws CrafartServiceException {
  
          DimensionDO dimensionDO = beanMapper.mapDimensionBOToDO(dimensionBO, new DimensionDO(), beanMapper.mapLengthClassBOToDO(dimensionBO.getLengthCassBO(), new LengthClassDO()));
          try {
  
              dimensionDAOImpl.addDimension(dimensionDO);
              dimensionBO.setDimensionId(dimensionBO.getDimensionId());
              //LengthClassDO lengthClassDO = lengthClassDAOImpl.getLengthClass(dimensionBO.getLengthCassBO().getLengthClassId());
              //dimensionDO.setLengthClassDO(lengthClassDO);
          } catch (CrafartDataException e) {
              throw new CrafartServiceException("Error while adding dimension", e);
  
          }
  
      }
  </code></pre>
  
  <p>this is my dimensionDAOimpl</p>
  
  <pre><code>@Override
      @Transactional(propagation = Propagation.REQUIRED)
      public void addDimension(DimensionDO dimensionDO) throws CrafartDataException {
          try {
              Session session = this.getSessionFactory().getCurrentSession();
              session.persist(dimensionDO);
          } catch (HibernateException hExp) {
              throw new CrafartDataException("DB Error while adding dimension details in table", hExp);
          }
      }
  
  }
  </code></pre>
  
  <p>DO to BO mapping</p>
  
  <pre><code>public DimensionBO mapDimensionDOTOBO(DimensionDO dimensionDO,DimensionBO dimensionBO,LengthClassBO lengthClassBO) {
          dimensionBO.setDimensionId(dimensionBO.getDimensionId());
          dimensionBO.setHeight(dimensionBO.getHeight());
          dimensionBO.setLength(dimensionBO.getLength());
          dimensionBO.setWidth(dimensionBO.getWidth());
          dimensionBO.setLengthClassBO(lengthClassBO);
          return dimensionBO;
      }
  </code></pre>
  
  <p>BO to DO mapping</p>
  
  <pre><code>public DimensionDO mapDimensionBOToDO(DimensionBO dimensionBO, DimensionDO dimensionDO ,LengthClassDO lengthClassDO)  {
          dimensionDO.setDimensionId(dimensionDO.getDimensionId());
          dimensionDO.setHeight(dimensionDO.getHeight());
          dimensionDO.setLength(dimensionDO.getLength());
          dimensionDO.setWidth(dimensionDO.getWidth());
          dimensionDO.setLengthClassDO(lengthClassDO);
  
          return dimensionDO;
      }
  </code></pre>