Merge pull request #3377 from ebean-orm/feature/3374

querybeans: #3374 - Add copy() method to TQRootBean
This commit is contained in:
Rob Bygrave
2024-04-01 09:09:24 +13:00
committed by GitHub
4 changed files with 9 additions and 3 deletions
@@ -153,6 +153,11 @@ public abstract class TQRootBean<T, R> {
return ((SpiFetchGroupQuery<T>) query()).buildFetchGroup();
}
/**
* Return a copy of the query bean.
*/
public abstract R copy();
/**
* Return the underlying query.
* <p>
@@ -63,7 +63,7 @@ class KotlinLangAdapter implements LangAdapter {
writer.append(" /**").eol();
writer.append(" * @deprecated migrate to query.usingTransaction()", name).eol();
writer.append(" */").eol();
writer.append(" @Deprecated").eol();
writer.append(" @Deprecated(message=\"migrate to query.usingTransaction()\")").eol();
if (dbName == null) {
writer.append(" constructor(transaction: io.ebean.Transaction) : super(%s::class.java, transaction)", fullName).eol().eol();
} else {
@@ -88,7 +88,7 @@ class KotlinLangAdapter implements LangAdapter {
writer.eol();
writer.append(" /** Return a copy of the query. */").eol();
writer.append(" fun copy() : Q%s {", shortName).eol();
writer.append(" override fun copy() : Q%s {", shortName).eol();
writer.append(" return Q%s(query().copy())", shortName).eol();
writer.append(" }").eol();
writer.eol();
@@ -197,6 +197,7 @@ class SimpleQueryBeanWriter {
writer.eol();
writer.append(" /** Return a copy of the query bean. */").eol();
writer.append(" @Override").eol();
writer.append(" public Q%s copy() {", shortName).eol();
writer.append(" return new Q%s(query().copy());", shortName).eol();
writer.append(" }").eol();
+1 -1
View File
@@ -92,7 +92,7 @@
<groupId>io.ebean</groupId>
<artifactId>kotlin-querybean-generator</artifactId>
<!-- <artifactId>querybean-generator</artifactId>-->
<version>14.0.0</version>
<version>14.0.2</version>
</annotationProcessorPath>
</annotationProcessorPaths>
</configuration>