Hibernate exception while saving with cascade=“save-update”

前端 未结 3 2003
梦如初夏
梦如初夏 2021-01-25 05:04

Here is my hbm and test code respectively. I am using Spring\'s HibernateTemplate. I doesn\'t use DAO. Hibernate 2.2.5 with Spring 2.0.7

hbm

<         


        
3条回答
  •  半阙折子戏
    2021-01-25 05:11

    Ok the root cause was the invalid mapping on my part for the collection. Thanks to this article on composite mapping

    Wrong:

    
      
    
    

    Correct

    
    
    
      
        
      
      
    
    

    Complete mapping

    
            
                
                    PRODUCT_SN
                
            
    
            
    
            
                
                    
                
                
            
            
            
            
            
            
            
        
    

提交回复
热议问题