querybeans: #3374 - Add copy() method to TQRootBean

This commit is contained in:
Rob Bygrave
2024-03-31 11:44:32 +13:00
parent 7bf030f59c
commit cdbdd98d36
3 changed files with 7 additions and 1 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>
@@ -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();