Open christophstrobl opened 1 year ago
There are tabbed switchers available, see https://github.com/spring-projects/spring-framework/blob/v6.0.11/framework-docs/modules/ROOT/pages/data-access/jdbc/core.adoc:
[tabs]
======
Java::
+
[source,java,indent=0,subs="verbatim,quotes",role="primary"]
----
List<Actor> actors = this.jdbcTemplate.query(
"select first_name, last_name from t_actor",
(resultSet, rowNum) -> {
Actor actor = new Actor();
actor.setFirstName(resultSet.getString("first_name"));
actor.setLastName(resultSet.getString("last_name"));
return actor;
});
----
Kotlin::
+
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"]
----
val actors = jdbcTemplate.query("select first_name, last_name from t_actor") { rs, _ ->
Actor(rs.getString("first_name"), rs.getString("last_name"))
----
======
Seems we applied this in several places. Anything left to do here?
For some features (eg. auditing) the actual usage patterns are not that different between the imperative and reactive bits. Still the configuration may differ. So there may be options to reduce duplication and potentially simplify the documentation by having toggles that allow to switch code snippets for those parts.