Skip to content

Commit 045fefd

Browse files
authored
Rename AppConfig to DbConfig (#611)
[skip ci]
1 parent 0d05539 commit 045fefd

File tree

4 files changed

+21
-20
lines changed

4 files changed

+21
-20
lines changed

docs/config.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -245,17 +245,17 @@ The simple definition is appropriate in following cases:
245245

246246
.. code-block:: java
247247
248-
public class AppConfig implements Config {
248+
public class DbConfig implements Config {
249249
250-
private static final AppConfig CONFIG = new AppConfig();
250+
private static final DbConfig CONFIG = new DbConfig();
251251
252252
private final Dialect dialect;
253253
254254
private final LocalTransactionDataSource dataSource;
255255
256256
private final TransactionManager transactionManager;
257257
258-
private AppConfig() {
258+
private DbConfig() {
259259
dialect = new H2Dialect();
260260
dataSource = new LocalTransactionDataSource(
261261
"jdbc:h2:mem:tutorial;DB_CLOSE_DELAY=-1", "sa", null);
@@ -278,16 +278,16 @@ The simple definition is appropriate in following cases:
278278
return transactionManager;
279279
}
280280
281-
public static AppConfig singleton() {
281+
public static DbConfig singleton() {
282282
return CONFIG;
283283
}
284284
}
285285
286-
You can use the above ``AppConfig`` class as follows:
286+
You can use the above ``DbConfig`` class as follows:
287287

288288
.. code-block:: java
289289
290-
EmployeeDao dao = new EmployeeDaoImpl(AppConfig.singleton());
290+
EmployeeDao dao = new EmployeeDaoImpl(DbConfig.singleton());
291291
292292
The above ``EmployeeDao`` interface must be annotated with the ``@Dao`` annotation as follows:
293293

@@ -312,7 +312,7 @@ Suppose the ``dialect`` and the ``dataSource`` are injected by the dependency in
312312

313313
.. code-block:: java
314314
315-
public class AppConfig implements Config {
315+
public class DbConfig implements Config {
316316
317317
private Dialect dialect;
318318

docs/transaction.rst

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,17 @@ Here is an example:
3030

3131
.. code-block:: java
3232
33-
public class AppConfig implements Config {
33+
public class DbConfig implements Config {
3434
35-
private static final AppConfig CONFIG = new AppConfig();
35+
private static final DbConfig CONFIG = new DbConfig();
3636
3737
private final Dialect dialect;
3838
3939
private final LocalTransactionDataSource dataSource;
4040
4141
private final TransactionManager transactionManager;
4242
43-
private AppConfig() {
43+
private DbConfig() {
4444
dialect = new H2Dialect();
4545
dataSource = new LocalTransactionDataSource(
4646
"jdbc:h2:mem:tutorial;DB_CLOSE_DELAY=-1", "sa", null);
@@ -63,7 +63,7 @@ Here is an example:
6363
return transactionManager;
6464
}
6565
66-
public static AppConfig singleton() {
66+
public static DbConfig singleton() {
6767
return CONFIG;
6868
}
6969
}
@@ -102,8 +102,8 @@ Use a lambda expression to write a process which you want to run in a transactio
102102

103103
.. code-block:: java
104104
105-
TransactionManager tm = AppConfig.singleton().getTransactionManager();
106-
EmployeeDao dao = new EmployeeDaoImpl(AppConfig.singleton());
105+
TransactionManager tm = DbConfig.singleton().getTransactionManager();
106+
EmployeeDao dao = new EmployeeDaoImpl(DbConfig.singleton());
107107
108108
tm.required(() -> {
109109
Employee employee = dao.selectById(1);
@@ -122,8 +122,8 @@ Besides throwing an exception, you can use ``setRollbackOnly`` method to rollbac
122122

123123
.. code-block:: java
124124
125-
TransactionManager tm = AppConfig.singleton().getTransactionManager();
126-
EmployeeDao dao = new EmployeeDaoImpl(AppConfig.singleton());
125+
TransactionManager tm = DbConfig.singleton().getTransactionManager();
126+
EmployeeDao dao = new EmployeeDaoImpl(DbConfig.singleton());
127127
128128
tm.required(() -> {
129129
Employee employee = dao.selectById(1);
@@ -141,8 +141,8 @@ With a savepoint, you can cancel specific changes in a transaction.
141141

142142
.. code-block:: java
143143
144-
TransactionManager tm = AppConfig.singleton().getTransactionManager();
145-
EmployeeDao dao = new EmployeeDaoImpl(AppConfig.singleton());
144+
TransactionManager tm = DbConfig.singleton().getTransactionManager();
145+
EmployeeDao dao = new EmployeeDaoImpl(DbConfig.singleton());
146146
147147
tm.required(() -> {
148148
// Search and update

doma-core/src/main/java/org/seasar/doma/jdbc/tx/KeepAliveLocalTransaction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* <p>This instance is thread safe.
1414
*
1515
* <pre>
16-
* KeepAliveLocalTransaction tx = AppConfig.getKeepAliveLocalTransaction();
16+
* KeepAliveLocalTransaction tx = DbConfig.singleton().getKeepAliveLocalTransaction();
1717
* tx.init();
1818
* try {
1919
* try {

doma-core/src/main/java/org/seasar/doma/jdbc/tx/LocalTransaction.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
* the transaction always by {@link #commit()} or {@link #rollback()}.
2222
*
2323
* <pre>
24-
* LocalTransaction tx = AppConfig.getLocalTransaction();
24+
* LocalTransaction tx = DbConfig.singleton().getLocalTransaction();
2525
* try {
2626
* tx.begin();
2727
*
@@ -39,7 +39,8 @@
3939
* Same instance can handle multiple transactions sequentially.
4040
*
4141
* <pre>
42-
* LocalTransaction tx = AppConfig.getLocalTransaction();
42+
* Db
43+
* LocalTransaction tx = DbConfig.singleton().getLocalTransaction();
4344
* // transaction 1
4445
* try {
4546
* tx.begin();

0 commit comments

Comments
 (0)