mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-10-23 23:28:55 +00:00
Refactor plugin.BeanType addInheritanceWhere() to just take Query and not SpiQuery
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
package io.ebean.plugin;
|
||||
|
||||
import io.ebean.Query;
|
||||
import io.ebean.config.dbplatform.IdType;
|
||||
import io.ebean.event.BeanFindController;
|
||||
import io.ebean.event.BeanPersistController;
|
||||
import io.ebean.event.BeanPersistListener;
|
||||
import io.ebean.event.BeanQueryAdapter;
|
||||
import io.ebeaninternal.api.SpiQuery;
|
||||
import io.ebeanservice.docstore.api.mapping.DocumentMapping;
|
||||
|
||||
import java.util.Collection;
|
||||
@@ -180,7 +180,7 @@ public interface BeanType<T> {
|
||||
/**
|
||||
* Add the discriminator value to the query if needed.
|
||||
*/
|
||||
void addInheritanceWhere(SpiQuery<?> query);
|
||||
void addInheritanceWhere(Query<?> query);
|
||||
|
||||
/**
|
||||
* Return the root bean type for an inheritance hierarchy.
|
||||
|
||||
@@ -2379,7 +2379,7 @@ public class BeanDescriptor<T> implements MetaBeanInfo, BeanType<T> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInheritanceWhere(SpiQuery<?> query) {
|
||||
public void addInheritanceWhere(Query<?> query) {
|
||||
if (inheritInfo != null && !inheritInfo.isRoot()) {
|
||||
query.where().eq(inheritInfo.getDiscriminatorColumn(), inheritInfo.getDiscriminatorValue());
|
||||
}
|
||||
|
||||
@@ -229,13 +229,13 @@ public class BeanTypeTest {
|
||||
@Test
|
||||
public void addInheritanceWhere_when_leaf() {
|
||||
Query<Vehicle> query = server.find(Vehicle.class);
|
||||
beanType(Car.class).addInheritanceWhere((SpiQuery<?>) query);
|
||||
beanType(Car.class).addInheritanceWhere(query);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void addInheritanceWhere_when_root() {
|
||||
Query<Vehicle> query = server.find(Vehicle.class);
|
||||
beanType(Vehicle.class).addInheritanceWhere((SpiQuery<?>) query);
|
||||
beanType(Vehicle.class).addInheritanceWhere(query);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user