#1165 - ENH: Add to Finder - currentTransaction() and flush() methods ... (as useful shortcuts)

This commit is contained in:
rob bygrave
2017-10-09 21:13:12 +13:00
parent 2fe1a349c3
commit 45a571bd97
2 changed files with 56 additions and 2 deletions
+15
View File
@@ -92,6 +92,20 @@ public class Finder<I, T> {
this.serverName = serverName;
}
/**
* Return the current transaction.
*/
public Transaction currentTransaction() {
return db().currentTransaction();
}
/**
* Flush the JDBC batch on the current transaction.
*/
public void flush() {
db().flush();
}
/**
* Return the underlying 'default' EbeanServer.
* <p>
@@ -170,4 +184,5 @@ public class Finder<I, T> {
public Query<T> query(String ormQuery) {
return db().createQuery(type, ormQuery);
}
}