mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
#3270 Fix for use with BeanFindController and attribute queries
The existence of a BeanFindController should not break the use of single attribute queries + still allow auto-tuning.
This commit is contained in:
@@ -961,7 +961,7 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
|
||||
}
|
||||
if (!query.isRawSql()) {
|
||||
query.setDefaultRawSqlIfRequired();
|
||||
if (query.isAutoTunable() && !autoTuneService.tuneQuery(query)) {
|
||||
if (!query.isAutoTunable() || !autoTuneService.tuneQuery(query)) {
|
||||
// use deployment FetchType.LAZY/EAGER annotations
|
||||
// to define the 'default' select clause
|
||||
query.setDefaultSelectClause();
|
||||
|
||||
@@ -278,7 +278,7 @@ public class BeanDescriptor<T> implements BeanType<T>, STreeType, SpiBeanType {
|
||||
this.partitionMeta = deploy.getPartitionMeta();
|
||||
this.tablespaceMeta = deploy.getTablespaceMeta();
|
||||
this.storageEngine = deploy.getStorageEngine();
|
||||
this.autoTunable = beanFinder == null && (entityType == EntityType.ORM || entityType == EntityType.VIEW);
|
||||
this.autoTunable = entityType == EntityType.ORM || entityType == EntityType.VIEW;
|
||||
// helper object used to derive lists of properties
|
||||
DeployBeanPropertyLists listHelper = new DeployBeanPropertyLists(owner, this, deploy);
|
||||
this.softDeleteProperty = listHelper.getSoftDeleteProperty();
|
||||
|
||||
@@ -26,7 +26,7 @@ public class SpiServerTest extends BaseTestCase {
|
||||
BeanType<Customer> beanType = pluginApi.beanType(Customer.class);
|
||||
assertEquals("o_customer", beanType.baseTable());
|
||||
assertNotNull(pluginApi.databasePlatform());
|
||||
assertNull(beanType.findController());
|
||||
assertNotNull(beanType.findController());
|
||||
assertNotNull(beanType.persistController());
|
||||
assertNull(beanType.persistListener());
|
||||
assertNull(beanType.queryAdapter());
|
||||
|
||||
Reference in New Issue
Block a user