Skip to content

Commit 195edf0

Browse files
authored
Merge pull request #3514 from ebean-orm/feature/querybean-txn-ctor
Remove deprecated QueryBean constructor that takes transaction, migrate to query.usingTransaction()
2 parents 1bf9d1d + e9c438a commit 195edf0

File tree

4 files changed

+2
-35
lines changed

4 files changed

+2
-35
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 & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,6 @@ void rootBeanConstructor(Append writer, String shortName, String dbName, String
2828
writer.append(" constructor() : super(%s::class.java, io.ebean.DB.byName(\"%s\"))", fullName, dbName).eol().eol();
2929
}
3030

31-
writer.append(" /** @deprecated migrate to query.usingTransaction() */", name).eol();
32-
writer.append(" @Deprecated(message=\"migrate to query.usingTransaction()\")").eol();
33-
if (dbName == null) {
34-
writer.append(" constructor(transaction: io.ebean.Transaction) : super(%s::class.java, transaction)", fullName).eol().eol();
35-
} else {
36-
writer.append(" constructor(transaction: io.ebean.Transaction) : super(%s::class.java, io.ebean.DB.byName(\"%s\"), transaction)", fullName, dbName).eol().eol();
37-
}
38-
3931
writer.append(" /** Construct with a given Database. */").eol();
4032
writer.append(" constructor(database: io.ebean.Database) : super(%s::class.java, database)", fullName).eol().eol();
4133

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)