Spring-Hibernate persist does not result in insert

后端 未结 2 671
忘掉有多难
忘掉有多难 2021-02-09 22:09

I\'m trying to implement a simple DAO. I have a Dao:

@Repository(\"iUserDao\")
@Transactional(readOnly = true)
public class UserDao implements IUserDao {
    pri         


        
2条回答
  •  忘了有多久
    2021-02-09 22:25

    Try setting the transactional propagation to required, and remove all flush():-

    @Repository("iUserDao")
    @Transactional(propagation=Propagation.REQUIRED)
    public class UserDao implements IUserDao {
       ...
    }
    

提交回复
热议问题