mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-17 22:56:28 +00:00
#1063 - Add Event Listeners capable of being notified for delete by query or update by query
Adds QueryType and adds method query.getQueryType() which then can be used in a BeanQueryAdapter
This commit is contained in:
1 parent
40704e2ef7
commit
8b18e907af
5 files changed
+80
-4
No files matched your search
@@ -17,6 +17,7 @@ import io.ebean.PersistenceContextScope;
|
||||
import io.ebean.ProfileLocation;
|
||||
import io.ebean.Query;
|
||||
import io.ebean.QueryIterator;
|
||||
import io.ebean.QueryType;
|
||||
import io.ebean.RawSql;
|
||||
import io.ebean.Version;
|
||||
import io.ebean.bean.CallStack;
|
||||
@@ -914,6 +915,19 @@ public class DefaultOrmQuery<T> implements SpiQuery<T> {
|
||||
this.profilingListener = profilingListener;
|
||||
}
|
||||
|
||||
@Override
|
||||
public QueryType getQueryType() {
|
||||
if (type != null) {
|
||||
switch (type) {
|
||||
case DELETE:
|
||||
return QueryType.DELETE;
|
||||
case UPDATE:
|
||||
return QueryType.UPDATE;
|
||||
}
|
||||
}
|
||||
return QueryType.FIND;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Mode getMode() {
|
||||
return mode;
|
||||
|
||||
Reference in new issue
Block a user