Skip to content

Commit 27bf1d8

Browse files
committed
Update document for #1248
1 parent 734111d commit 27bf1d8

File tree

5 files changed

+60
-30
lines changed

5 files changed

+60
-30
lines changed

src/site/es/xdoc/configuration.xml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1507,13 +1507,15 @@ public class ExampleObjectFactory extends DefaultObjectFactory {
15071507
method = "update",
15081508
args = {MappedStatement.class,Object.class})})
15091509
public class ExamplePlugin implements Interceptor {
1510+
private Properties properties = new Properties();
15101511
public Object intercept(Invocation invocation) throws Throwable {
1511-
return invocation.proceed();
1512-
}
1513-
public Object plugin(Object target) {
1514-
return Plugin.wrap(target, this);
1512+
// implement pre processing if need
1513+
Object returnObject = invocation.proceed();
1514+
// implement post processing if need
1515+
return returnObject;
15151516
}
15161517
public void setProperties(Properties properties) {
1518+
this.properties = properties;
15171519
}
15181520
}]]></source>
15191521

@@ -1603,7 +1605,9 @@ SqlSessionFactory factory = new SqlSessionFactoryBuilder().build(reader,properti
16031605
<p>Ninguno de estos TransactionManagers necesita ninguna propiedad. Sin embargo ambos son Type Aliases, es decir, en lugar de usarlos puedes informar el nombre totalmente cualificado o el Type Alias de tu propia implementación del interfaz TransactionFactory:
16041606
</p>
16051607
<source><![CDATA[public interface TransactionFactory {
1606-
void setProperties(Properties props);
1608+
default void setProperties(Properties props) { // Since 3.5.2, change to default method
1609+
// NOP
1610+
}
16071611
Transaction newTransaction(Connection conn);
16081612
Transaction newTransaction(DataSource dataSource, TransactionIsolationLevel level, boolean autoCommit);
16091613
}]]></source>
@@ -1771,7 +1775,9 @@ public class C3P0DataSourceFactory extends UnpooledDataSourceFactory {
17711775
</p>
17721776

17731777
<source><![CDATA[public interface DatabaseIdProvider {
1774-
void setProperties(Properties p);
1778+
default void setProperties(Properties p) { // Since 3.5.2, change to default method
1779+
// NOP
1780+
}
17751781
String getDatabaseId(DataSource dataSource) throws SQLException;
17761782
}]]></source>
17771783

src/site/ja/xdoc/configuration.xml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1551,13 +1551,15 @@ public class ExampleObjectFactory extends DefaultObjectFactory {
15511551
method = "update",
15521552
args = {MappedStatement.class,Object.class})})
15531553
public class ExamplePlugin implements Interceptor {
1554+
private Properties properties = new Properties();
15541555
public Object intercept(Invocation invocation) throws Throwable {
1555-
return invocation.proceed();
1556-
}
1557-
public Object plugin(Object target) {
1558-
return Plugin.wrap(target, this);
1556+
// implement pre processing if need
1557+
Object returnObject = invocation.proceed();
1558+
// implement post processing if need
1559+
return returnObject;
15591560
}
15601561
public void setProperties(Properties properties) {
1562+
this.properties = properties;
15611563
}
15621564
}]]></source>
15631565

@@ -1679,7 +1681,9 @@ SqlSessionFactory factory = new SqlSessionFactoryBuilder().build(reader,properti
16791681
トランザクションマネージャーに必須のプロパティはありませんが、これらはともにタイプエイリアスです。つまり、TransactionFactory インターフェイスの実装クラスの完全修飾クラス名を指定すれば、MyBatis が用意した二種類のトランザクションマネージャーの代わりに独自に実装したトランザクションマネージャーを利用することが可能です。
16801682
</p>
16811683
<source><![CDATA[public interface TransactionFactory {
1682-
void setProperties(Properties props);
1684+
default void setProperties(Properties props) { // Since 3.5.2, change to default method
1685+
// NOP
1686+
}
16831687
Transaction newTransaction(Connection conn);
16841688
Transaction newTransaction(DataSource dataSource, TransactionIsolationLevel level, boolean autoCommit);
16851689
}]]></source>
@@ -1878,7 +1882,9 @@ public class C3P0DataSourceFactory extends UnpooledDataSourceFactory {
18781882
</p>
18791883

18801884
<source><![CDATA[public interface DatabaseIdProvider {
1881-
void setProperties(Properties p);
1885+
default void setProperties(Properties p) { // Since 3.5.2, change to default method
1886+
// NOP
1887+
}
18821888
String getDatabaseId(DataSource dataSource) throws SQLException;
18831889
}]]></source>
18841890

src/site/ko/xdoc/configuration.xml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1474,13 +1474,15 @@ public class ExampleObjectFactory extends DefaultObjectFactory {
14741474
method = "update",
14751475
args = {MappedStatement.class,Object.class})})
14761476
public class ExamplePlugin implements Interceptor {
1477+
private Properties properties = new Properties();
14771478
public Object intercept(Invocation invocation) throws Throwable {
1478-
return invocation.proceed();
1479-
}
1480-
public Object plugin(Object target) {
1481-
return Plugin.wrap(target, this);
1479+
// implement pre processing if need
1480+
Object returnObject = invocation.proceed();
1481+
// implement post processing if need
1482+
return returnObject;
14821483
}
14831484
public void setProperties(Properties properties) {
1485+
this.properties = properties;
14841486
}
14851487
}]]></source>
14861488

@@ -1573,7 +1575,9 @@ SqlSessionFactory factory = new SqlSessionFactoryBuilder().build(reader,properti
15731575
어쨌든 둘다 타입 별칭이 있다.
15741576
즉 TransactionFactory를 위한 클래스 명이나 타입 별칭 중 하나를 사용할 수 있다.</p>
15751577
<source><![CDATA[public interface TransactionFactory {
1576-
void setProperties(Properties props);
1578+
default void setProperties(Properties props) { // Since 3.5.2, change to default method
1579+
// NOP
1580+
}
15771581
Transaction newTransaction(Connection conn);
15781582
Transaction newTransaction(DataSource dataSource, TransactionIsolationLevel level, boolean autoCommit);
15791583
}]]></source>
@@ -1724,7 +1728,9 @@ public class C3P0DataSourceFactory extends UnpooledDataSourceFactory {
17241728
</p>
17251729

17261730
<source><![CDATA[public interface DatabaseIdProvider {
1727-
void setProperties(Properties p);
1731+
default void setProperties(Properties p) { // Since 3.5.2, change to default method
1732+
// NOP
1733+
}
17281734
String getDatabaseId(DataSource dataSource) throws SQLException;
17291735
}]]></source>
17301736

src/site/xdoc/configuration.xml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1675,13 +1675,15 @@ public class ExampleObjectFactory extends DefaultObjectFactory {
16751675
method = "update",
16761676
args = {MappedStatement.class,Object.class})})
16771677
public class ExamplePlugin implements Interceptor {
1678+
private Properties properties = new Properties();
16781679
public Object intercept(Invocation invocation) throws Throwable {
1679-
return invocation.proceed();
1680-
}
1681-
public Object plugin(Object target) {
1682-
return Plugin.wrap(target, this);
1680+
// implement pre processing if need
1681+
Object returnObject = invocation.proceed();
1682+
// implement post processing if need
1683+
return returnObject;
16831684
}
16841685
public void setProperties(Properties properties) {
1686+
this.properties = properties;
16851687
}
16861688
}]]></source>
16871689

@@ -1846,7 +1848,9 @@ SqlSessionFactory factory = new SqlSessionFactoryBuilder().build(reader, propert
18461848
TransactionFactory interface.
18471849
</p>
18481850
<source><![CDATA[public interface TransactionFactory {
1849-
void setProperties(Properties props);
1851+
default void setProperties(Properties props) { // Since 3.5.2, change to default method
1852+
// NOP
1853+
}
18501854
Transaction newTransaction(Connection conn);
18511855
Transaction newTransaction(DataSource dataSource, TransactionIsolationLevel level, boolean autoCommit);
18521856
}]]></source>
@@ -2098,7 +2102,9 @@ public class C3P0DataSourceFactory extends UnpooledDataSourceFactory {
20982102
</p>
20992103

21002104
<source><![CDATA[public interface DatabaseIdProvider {
2101-
void setProperties(Properties p);
2105+
default void setProperties(Properties p) { // Since 3.5.2, change to default method
2106+
// NOP
2107+
}
21022108
String getDatabaseId(DataSource dataSource) throws SQLException;
21032109
}]]></source>
21042110

src/site/zh/xdoc/configuration.xml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1515,13 +1515,15 @@ public class ExampleObjectFactory extends DefaultObjectFactory {
15151515
method = "update",
15161516
args = {MappedStatement.class,Object.class})})
15171517
public class ExamplePlugin implements Interceptor {
1518+
private Properties properties = new Properties();
15181519
public Object intercept(Invocation invocation) throws Throwable {
1519-
return invocation.proceed();
1520-
}
1521-
public Object plugin(Object target) {
1522-
return Plugin.wrap(target, this);
1520+
// implement pre processing if need
1521+
Object returnObject = invocation.proceed();
1522+
// implement post processing if need
1523+
return returnObject;
15231524
}
15241525
public void setProperties(Properties properties) {
1526+
this.properties = properties;
15251527
}
15261528
}]]></source>
15271529

@@ -1632,7 +1634,9 @@ SqlSessionFactory factory = new SqlSessionFactoryBuilder().build(reader, propert
16321634
TransactionFactory 接口的实现类的完全限定名或类型别名代替它们。
16331635
</p>
16341636
<source><![CDATA[public interface TransactionFactory {
1635-
void setProperties(Properties props);
1637+
default void setProperties(Properties props) { // Since 3.5.2, change to default method
1638+
// NOP
1639+
}
16361640
Transaction newTransaction(Connection conn);
16371641
Transaction newTransaction(DataSource dataSource, TransactionIsolationLevel level, boolean autoCommit);
16381642
}]]></source>
@@ -1793,7 +1797,9 @@ public class C3P0DataSourceFactory extends UnpooledDataSourceFactory {
17931797
</p>
17941798

17951799
<source><![CDATA[public interface DatabaseIdProvider {
1796-
void setProperties(Properties p);
1800+
default void setProperties(Properties p) { // Since 3.5.2, change to default method
1801+
// NOP
1802+
}
17971803
String getDatabaseId(DataSource dataSource) throws SQLException;
17981804
}]]></source>
17991805

0 commit comments

Comments
 (0)