-
Notifications
You must be signed in to change notification settings - Fork 951
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DomainClassMarshaller and domain classes with composite key #11450
Closed
Comments
We have the same issue with rendering the UserRole class from the the SpringSecurityCore plugin. It works fine in Grails 3.3.11 but is broken in 4.0.1
|
davydotcom
added a commit
to davydotcom/grails-plugin-converters
that referenced
this issue
Jul 1, 2020
…entity() property is null for a composite key. This skips the rendering of the identity if it is null. However, it does not render the properties either since they are not considered persistentProperties(). It is recommended to use a custom marshaller as Composite keys, though supported, are not recommmended as per the documentation. Also updated project to gradle 6.5
graemerocher
added a commit
to grails/grails-plugin-converters
that referenced
this issue
Jul 2, 2020
Partially fixes grails/grails-core#11450 . The PersistentEntity getId…
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The DomainClassMarshaller in Grails 4.0.1 no longer seems to support rendering JSON from domain objects that map the id attribute to a composite key. Our current thought is that at some point, the DomainClassMarshaller was updated to reference the id attribute of the domain class. Since the id of a composite key is remapped, the DomainClassMarshaller throws a null pointer exception when referencing it.
Note that we are upgrading from 2.5.4, so we don't know when this issue was introduced.
Errors are thrown whether using code such as:
or when using a JSON View such as:
Beginning of stack trace:
Environment: local environment running Docker with latest Ubuntu image, Java 8
The text was updated successfully, but these errors were encountered: