From dd95081e631b6f9d13cfd734506a029ced9890ee Mon Sep 17 00:00:00 2001 From: Rob Bygrave Date: Wed, 7 Sep 2022 14:03:37 +1200 Subject: [PATCH] Update use example in README --- README.md | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 617ad1433..6e66440ff 100644 --- a/README.md +++ b/README.md @@ -9,21 +9,34 @@ to integrate with Springs JDBC Transaction manager. ## To use ```java -ServerConfig serverConfig = new ServerConfig(); +DatabaseConfig config = new DatabaseConfig(); // set SpringJdbcTransactionManager ... as the external transaction manager -serverConfig.setExternalTransactionManager(new SpringJdbcTransactionManager()); +config.setExternalTransactionManager(new SpringJdbcTransactionManager()); ... -EbeanServer server = EbeanServerFactory.create(serverConfig); +Database database = DatabaseFactory.create(config); ``` ## Notes You can use Ebean in Spring/Spring Boot *without* this and that case Ebean -manages the Transactions itself. With Ebean managing the transactions there +manages the Transactions itself. With Ebean managing the transactions there are some benefits with more control over JDBC batch, getGeneratedKeys and a simpler abstraction (as Spring transactions is designed to manage multiple resources such as JDBC Transactions and JPA EntityManager and Ebean -only needs to manage JDBC Transactions). \ No newline at end of file +only needs to manage JDBC Transactions). + + +## Java modules + +The module name is `io.ebean.spring.txn` + +```java +module foo { + + requires io.ebean.spring.txn; + ... +} +```