首页 > 编程知识 正文

configuration注解和component,configuration和component的区别

时间:2023-05-06 10:27:35 阅读:106033 作者:4987

1、代码示例@ modifying (clear automatically=true ) query ) value=' update customer _ advisers et ' ' audit status=? 1,' ' optUserCode=? 3,' ' optUserName=? 4 ' ' where id=? 2 ',native query=true (intupdatecustomeradviserstatusbyid ) intauditresult,Long id,String optUserCode, String optUserName 2,深入了解@Modifying,进入此注释(源代码,已经贴在文章后面),它是基础的持久化上下文,即entityManager Jpa的低级实现具有一级缓存。 也就是说,更新数据库后,当您使用此对象时,它会再次检查此对象。 此对象位于一级高速缓存中,但与数据库不同步。 在这种情况下,如果clearAutomatically=true,则会更新Hibernate的一级缓存,否则将在同一接口上更新对象,然后运行查询

defineswhetherweshouldcleartheunderlyingpersistencecontextafterexecutingthemodifyingquery。

翻译:

定义是否在执行变更查询后清除低级持久化上下文。

/* *版权2008-2016 theoriginalauthororauthors.* * licensedundertheapachelicense,version2.0(the'license ' ); * youmaynotusethisfileexceptincompliancewiththelicense.* youmayobtainacopyofthelicenseat * * http://ww.Apache.org/license unlessrequiredbyapplicablelaworagreedtoinwriting,software * distributedunderthelicenseisdistributedonan ' asis ' basis, * withoutwarrantiesorconditionsofanykind,eitherexpressorimplied.* seethelicenseforthespecificlanguagegoverningpermissssand import Java.lang.annotation.element type; import Java.lang.annotation.retention; import Java.lang.annotation.retention policy; import Java.lang.annotation.target;/* * * indicatesamethodshouldberegardedasmodifyingquery.* * @ authorolivergierke * @ authorchristophstrobl * @ authornicolaabl @ retention (retention policy.runtime ) target ) elementtype.method, element type.annotation _ type } @ documented public @ interface modifying {/* * * efineswhetherweshouldflushtheunderlyingpersistencecontextbeforeexecutingthemodifyingquery.* @ return */booleanflushautory defineswhetherweshouldcleartheunderlyingpersistencecontextafterexecutingthemodifyingquery.* * @ return */booleanclean }

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。