File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed
ebean-api/src/main/java/io/ebean
ebean-core/src/main/java/io/ebeaninternal/server/querydefn Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -367,6 +367,14 @@ default SqlQuery usingMaster() {
367367 */
368368 interface TypeQuery <T > {
369369
370+ /**
371+ * Ensure the master DataSource is used when useMaster is true. Otherwise, the read only
372+ * data source can be used if defined.
373+ *
374+ * @see SqlQuery#usingMaster(boolean)
375+ */
376+ TypeQuery <T > usingMaster (boolean useMaster );
377+
370378 /**
371379 * Execute the query using the given transaction.
372380 */
Original file line number Diff line number Diff line change @@ -269,6 +269,12 @@ private class Scalar<T> implements SqlQuery.TypeQuery<T> {
269269 this .type = type ;
270270 }
271271
272+ @ Override
273+ public TypeQuery <T > usingMaster (boolean useMaster ) {
274+ DefaultRelationalQuery .this .usingMaster (useMaster );
275+ return this ;
276+ }
277+
272278 @ Override
273279 public TypeQuery <T > usingTransaction (Transaction transaction ) {
274280 transaction (transaction );
@@ -308,6 +314,12 @@ private class Mapper<T> implements SqlQuery.TypeQuery<T> {
308314 this .mapper = mapper ;
309315 }
310316
317+ @ Override
318+ public TypeQuery <T > usingMaster (boolean useMaster ) {
319+ DefaultRelationalQuery .this .usingMaster (useMaster );
320+ return this ;
321+ }
322+
311323 @ Override
312324 public TypeQuery <T > usingTransaction (Transaction transaction ) {
313325 transaction (transaction );
You can’t perform that action at this time.
0 commit comments