Skip to content

Commit 7851c4c

Browse files
authored
Deprecate the config element of the Dao annotation (#603)
* Deprecate the config element of the Dao annotation * Deprecate the SingletonConfig annotation * Remove deprecated features from documents * Remove deprecated features from javadoc comments
1 parent 92ea3cd commit 7851c4c

File tree

164 files changed

+204
-74
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

164 files changed

+204
-74
lines changed

docs/basic.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ Using in DAO interface
104104

105105
.. code-block:: java
106106
107-
@Dao(config = AppConfig.class)
107+
@Dao
108108
public interface EmployeeDao {
109109
110110
@Select

docs/config.rst

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,8 @@ All JDBC drivers are loaded automatically by the `service provider <service prov
230230
For example, when you use Apache Tomcat, you will find the case.
231231
See also: `DriverManager, the service provider mechanism and memory leaks <tomcat driver_>`_
232232

233+
.. _config-configuration-definition:
234+
233235
Configuration definition
234236
========================
235237

@@ -243,7 +245,6 @@ The simple definition is appropriate in following cases:
243245

244246
.. code-block:: java
245247
246-
@SingletonConfig
247248
public class AppConfig implements Config {
248249
249250
private static final AppConfig CONFIG = new AppConfig();
@@ -282,22 +283,23 @@ The simple definition is appropriate in following cases:
282283
}
283284
}
284285
285-
.. note::
286+
You can use the above ``AppConfig`` class as follows:
287+
288+
.. code-block:: java
286289
287-
Remember to annotate the class with ``@SingletonConfig``
290+
EmployeeDao dao = new EmployeeDaoImpl(AppConfig.singleton());
288291
289-
Specify the above class to the config element of ``@Dao``.
292+
The above ``EmployeeDao`` interface must be annotated with the ``@Dao`` annotation as follows:
290293

291294
.. code-block:: java
292295
293-
@Dao(config = AppConfig.class)
296+
@Dao
294297
public interface EmployeeDao {
295298
296299
@Select
297300
Employee selectById(Integer id);
298301
}
299302
300-
301303
Advanced definition
302304
-------------------
303305

docs/dao.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ You can get ``Config`` instance associated dao instance if you call ``Config.get
3333

3434
.. code-block:: java
3535
36-
@Dao(config = AppConfig.class)
36+
@Dao
3737
public interface EmployeeDao {
3838
3939
default int count() {
@@ -81,7 +81,7 @@ One dao interface can handle more than one entity classes.
8181

8282
.. code-block:: java
8383
84-
@Dao(config = AppConfig.class)
84+
@Dao
8585
public interface MyDao {
8686
8787
@Select

docs/domain.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ The Domain classes showed above are used as follows:
328328
329329
.. code-block:: java
330330
331-
@Dao(config = AppConfig.class)
331+
@Dao
332332
public interface EmployeeDao {
333333
334334
@Select

docs/kotlin-support.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ Dao interfaces
7676
7777
.. code-block:: java
7878
79-
@Dao(config = AppConfig::class)
79+
@Dao
8080
interface PersonDao {
8181
@Sql("""
8282
select * from person where id = /*id*/0

docs/query/batch-delete.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Annotate with ``@BatchDelete`` to Dao method for execute batch delete.
99

1010
.. code-block:: java
1111
12-
@Config(config = AppConfig.class)
12+
@Dao
1313
public interface EmployeeDao {
1414
@BatchDelete
1515
int[] delete(List<Employee> employees);

docs/query/batch-insert.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Annotate with ``@BatchInsert`` to Dao method for execute batch insert.
99

1010
.. code-block:: java
1111
12-
@Config(config = AppConfig.class)
12+
@Dao
1313
public interface EmployeeDao {
1414
@BatchInsert
1515
int[] insert(List<Employee> employees);

docs/query/batch-update.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Annotate with ``@BatchUpdate`` to Dao method for execute batch update.
99

1010
.. code-block:: java
1111
12-
@Config(config = AppConfig.class)
12+
@Dao
1313
public interface EmployeeDao {
1414
@BatchUpdate
1515
int[] update(List<Employee> employees);

docs/query/delete.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Annotate with ``@Delete`` to Dao method for execute delete.
99

1010
.. code-block:: java
1111
12-
@Config(config = AppConfig.class)
12+
@Dao
1313
public interface EmployeeDao {
1414
@Delete
1515
int delete(Employee employee);

docs/query/function.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ To call stored functions, you must annotate DAO methods with the ``@Function`` a
99

1010
.. code-block:: java
1111
12-
@Config(config = AppConfig.class)
12+
@Dao
1313
public interface EmployeeDao {
1414
@Function
1515
Integer execute(@In Integer id, @InOut Reference<BigDecimal> salary);

0 commit comments

Comments
 (0)