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 want to use this "association" in a criteria, but that throws a groovy.lang.MissingMethodException: No signature of method error at knownContacts { ... }.
{
projections {
knownContacts {
id()
}
}
}
This is because gorm treats the "knownContacts" not as an association, but as an ELEMENT_COLLECTION.
Which means the isAssociation check fails on it, as its PersistentAttributeType is ELEMENT_COLLECTION.
There doesn't seem to be any code in AbstractHibernateCriteriaBuilder.invokeMethod that deals with ELEMENT_COLLECTIONs.
if (pd != null && pd.getReadMethod() != null) {
final Metamodel metamodel = sessionFactory.getMetamodel();
final EntityType<?> entityType = metamodel.entity(targetClass);
final Attribute<?, ?> attribute = entityType.getAttribute(name);
if (attribute.isAssociation())
[...]
The attribute.isAssociation check fails and the throw new MissingMethodException(name, getClass(), args); at the end of the method is reached.
I'm not sure if this is intentional or an oversight. Is there a different way we are supposed to query non domain to domain associations?
The generated database schema creates an extra table for ELEMENT_COLLECTION (at least in this case) so I'm not sure why they can't be used like regular associations between domain objects.
The text was updated successfully, but these errors were encountered:
I have a domain object with a collection of non-domain objects.
I want to use this "association" in a criteria, but that throws a
groovy.lang.MissingMethodException: No signature of method
error atknownContacts { ... }
.This is because gorm treats the "knownContacts" not as an association, but as an ELEMENT_COLLECTION.
Which means the isAssociation check fails on it, as its PersistentAttributeType is ELEMENT_COLLECTION.
There doesn't seem to be any code in AbstractHibernateCriteriaBuilder.invokeMethod that deals with ELEMENT_COLLECTIONs.
The
attribute.isAssociation
check fails and thethrow new MissingMethodException(name, getClass(), args);
at the end of the method is reached.I'm not sure if this is intentional or an oversight. Is there a different way we are supposed to query non domain to domain associations?
The generated database schema creates an extra table for ELEMENT_COLLECTION (at least in this case) so I'm not sure why they can't be used like regular associations between domain objects.
The text was updated successfully, but these errors were encountered: