You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an example Spring Data Jdbc Aggregate Root (not JPA)
@RequiredArgsConstructor(access = AccessLevel.PACKAGE, onConstructor = @__(@PersistenceCreator))
public class Person implements AggregateRoot<Person, PersonIdentifier> {
@Id private final PersonIdentifier id
private String name;
@Getter
@Embedded
private Address address;
}
with an embedded VO record:
public record Address(String city, String street} implements ValueObject
When I have three people, two persons who live in streets of Heilbronn and one Person who lives in a street of Berlin, and I run this qbe Query on my QueryByExampleExecutor:
I get no matches, because the generated query specifically asks for Persons with STREET = null. That only happens for embedded types - the generated query does not ask for persons where NAME == null, apparently because name is a top-level attribute. Log extract:
WHERE (("PERSON"."CITY" = ? AND "PERSON"."STREET" = ?))
Setting SQL statement parameter value: column index 1, parameter value [Heilbronn], value class [java.lang.String], SQL type 12
Setting SQL statement parameter value: column index 2, parameter value [null], value class [null], SQL type 12
I would expect two matches, all persons who live in Heilbronn.
Am I holding it wrong, or is ignoreNullValues simply not supported for embedded types?
The text was updated successfully, but these errors were encountered:
Example works on properties (and nested property paths). Embedding is merely a way to represent values in the table while the logical model should not care about embedding. I consider this a bug.
I have an example Spring Data Jdbc Aggregate Root (not JPA)
with an embedded VO record:
When I have three people, two persons who live in streets of Heilbronn and one Person who lives in a street of Berlin, and I run this qbe Query on my
QueryByExampleExecutor
:with this Person:
I get no matches, because the generated query specifically asks for Persons with STREET = null. That only happens for embedded types - the generated query does not ask for persons where NAME == null, apparently because name is a top-level attribute. Log extract:
I would expect two matches, all persons who live in Heilbronn.
Am I holding it wrong, or is
ignoreNullValues
simply not supported for embedded types?The text was updated successfully, but these errors were encountered: