File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -344,7 +344,8 @@ try (SqlSession session = sqlSessionFactory.openSession()) {
344
344
<td ><code >Class</code ></td >
345
345
<td ><code >< cacheRef> </code ></td >
346
346
<td >
347
- References the cache of another namespace to use. Attributes: <code >value</code > and <code >name</code >.
347
+ References the cache of another namespace to use. Note that caches declared in an XML mapper file are considered
348
+ a separate namespace, even if they share the same FQCN. Attributes: <code >value</code > and <code >name</code >.
348
349
If you use this annotation, you should be specified either <code >value</code > or <code >name</code > attribute.
349
350
For the <code >value</code > attribute specify a java type indicating the namespace(the namespace name become a FQCN of specified java type),
350
351
and for the <code >name</code > attribute(this attribute is available since 3.4.2) specify a name indicating the namespace.
Original file line number Diff line number Diff line change @@ -2013,7 +2013,7 @@ SELECT * FROM POST WHERE BLOG_ID = #{id}]]></source>
2013
2013
</p >
2014
2014
2015
2015
<p >
2016
- By default, just local sessión caching is enabled that is used solely to cache data for the duration of a sessión .
2016
+ By default, just local session caching is enabled that is used solely to cache data for the duration of a session .
2017
2017
To enable a global second level of caching you simply need to add one line to your SQL Mapping file:
2018
2018
</p >
2019
2019
@@ -2037,6 +2037,13 @@ SELECT * FROM POST WHERE BLOG_ID = #{id}]]></source>
2037
2037
</li >
2038
2038
</ul >
2039
2039
2040
+ <p >
2041
+ <span class =" label important" >NOTE</span > The cache will only apply to statements declared in the mapping file
2042
+ where the cache tag is located. If you are using the Java API in conjunction with the XML mapping files, then
2043
+ statements declared in the companion interface will not be cached by default. You will need to refer to the
2044
+ cache region using the @CacheNamespaceRef annotation.
2045
+ </p >
2046
+
2040
2047
<p >
2041
2048
All of these properties are modifiable through the attributes of the cache element. For example:
2042
2049
</p >
You can’t perform that action at this time.
0 commit comments