NaturalKeyQueryData use the matchSingleProperty + IntelliJ Inspect various improvements

The non-use of the matchSingleProperty meant it fell back to the multi-property match
This commit is contained in:
Rob Bygrave
2022-08-27 23:10:13 +12:00
parent 0c2ab729bc
commit e46bbcf8cf
4 changed files with 5 additions and 6 deletions
@@ -142,7 +142,9 @@ public final class NaturalKeyQueryData<T> {
*/
private boolean matchProperties() {
if (naturalKey.isSingleProperty()) {
naturalKey.matchSingleProperty((inProperty != null) ? inProperty : eqList.get(0).property);
if (naturalKey.matchSingleProperty((inProperty != null) ? inProperty : eqList.get(0).property)) {
return true;
}
}
// multiple properties case
@@ -314,7 +314,7 @@ public interface SpiQuery<T> extends Query<T>, SpiQueryFetch, TxnProfileEventCod
* Return true if select all properties was used to ensure the property
* invoking a lazy load was included in the query.
*/
boolean selectAllForLazyLoadProperty();
void selectAllForLazyLoadProperty();
/**
* Set the select properties.
@@ -1,6 +1,5 @@
package io.ebeaninternal.server.deploy;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
@@ -442,14 +442,12 @@ public class DefaultOrmQuery<T> extends AbstractQuery implements SpiQuery<T> {
* included in the query.
*/
@Override
public final boolean selectAllForLazyLoadProperty() {
public final void selectAllForLazyLoadProperty() {
if (lazyLoadProperty != null) {
if (!detail.containsProperty(lazyLoadProperty)) {
detail.select("*");
return true;
}
}
return false;
}
private List<OrmQueryProperties> removeQueryJoins() {