Skip to content

Commit ddb4b9d

Browse files
committed
Remove deprecated QueryBean constructor that takes transaction, migrate to query.usingTransaction()
Remove the constructor for QueryBean that takes transaction. Migrate code to use query.usingTransaction() instead.
1 parent 7035b4c commit ddb4b9d

File tree

4 files changed

+2
-37
lines changed

4 files changed

+2
-37
lines changed

ebean-querybean/src/main/java/io/ebean/typequery/QueryBean.java

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -99,22 +99,6 @@ protected QueryBean(Class<T> beanType, Database database) {
9999
this(database.find(beanType));
100100
}
101101

102-
/**
103-
* Construct with a transaction.
104-
*/
105-
protected QueryBean(Class<T> beanType, Transaction transaction) {
106-
this(beanType);
107-
query.usingTransaction(transaction);
108-
}
109-
110-
/**
111-
* Construct with a database and transaction.
112-
*/
113-
protected QueryBean(Class<T> beanType, Database database, Transaction transaction) {
114-
this(beanType, database);
115-
query.usingTransaction(transaction);
116-
}
117-
118102
/**
119103
* Construct using a query.
120104
*/

ebean-querybean/src/test/java/org/querytest/QCustomerTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,9 @@ public void findWithTransaction() {
4747

4848
database.save(customer, txn);
4949

50-
final Customer found = new QCustomer(txn)
50+
final Customer found = new QCustomer()
5151
.name.eq("explicitTransaction")
52+
.usingTransaction(txn)
5253
.findOne();
5354
assertThat(found).isNotNull();
5455

kotlin-querybean-generator/src/main/java/io/ebean/querybean/generator/KotlinLangAdapter.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -60,16 +60,6 @@ public void rootBeanConstructor(Append writer, String shortName, String dbName,
6060
writer.append(" constructor() : super(%s::class.java, io.ebean.DB.byName(\"%s\"))", fullName, dbName).eol().eol();
6161
}
6262

63-
writer.append(" /**").eol();
64-
writer.append(" * @deprecated migrate to query.usingTransaction()", name).eol();
65-
writer.append(" */").eol();
66-
writer.append(" @Deprecated(message=\"migrate to query.usingTransaction()\")").eol();
67-
if (dbName == null) {
68-
writer.append(" constructor(transaction: io.ebean.Transaction) : super(%s::class.java, transaction)", fullName).eol().eol();
69-
} else {
70-
writer.append(" constructor(transaction: io.ebean.Transaction) : super(%s::class.java, io.ebean.DB.byName(\"%s\"), transaction)", fullName, dbName).eol().eol();
71-
}
72-
7363
writer.eol();
7464
writer.append(" /**").eol();
7565
writer.append(" * Construct with a given Database.").eol();

querybean-generator/src/main/java/io/ebean/querybean/generator/SimpleQueryBeanWriter.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -160,16 +160,6 @@ private void writeConstructors() {
160160
writer.append(" }").eol();
161161
writer.eol();
162162

163-
writer.append(" /** @deprecated migrate to query.usingTransaction() */").eol();
164-
writer.append(" @Deprecated(forRemoval = true)").eol();
165-
writer.append(" public Q%s(io.ebean.Transaction transaction) {", shortName).eol();
166-
if (dbName == null) {
167-
writer.append(" super(%s.class, transaction);", beanFullName).eol();
168-
} else {
169-
writer.append(" super(%s.class, io.ebean.DB.byName(\"%s\"), transaction);", beanFullName, dbName).eol();
170-
}
171-
writer.append(" }").eol();
172-
173163
writer.eol();
174164
writer.append(" /** Construct with a given Database */").eol();
175165
writer.append(" public Q%s(io.ebean.Database database) {", shortName).eol();

0 commit comments

Comments
 (0)