Skip to content
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

Using a Record in NoSQL leads to several problems in turn #544

Closed
jesse-gallagher opened this issue Jul 18, 2024 · 1 comment
Closed

Using a Record in NoSQL leads to several problems in turn #544

jesse-gallagher opened this issue Jul 18, 2024 · 1 comment
Labels
bug Something isn't working nosql
Milestone

Comments

@jesse-gallagher
Copy link
Member

The initial problem is that ConstructorBuilder uses ServiceLoader on init, which won't fly.

Fixing that, though, leads to "List not implemented yet", which can be fixed by adding a ValueReader that can handle Lists.

However, that then leads to:

java.lang.IllegalArgumentException: argument type mismatch
    java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
    java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
    java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
    org.eclipse.jnosql.mapping.reflection.DefaultConstructorBuilder.build(DefaultConstructorBuilder.java:67)
    org.eclipse.jnosql.mapping.semistructured.EntityConverter.convertEntityByConstructor(EntityConverter.java:190)
    org.eclipse.jnosql.mapping.semistructured.EntityConverter.toEntity(EntityConverter.java:141)
    org.eclipse.jnosql.mapping.semistructured.DefaultEntityConverter$Proxy$_$$_WeldClientProxy.toEntity(Unknown Source)
    ...

Admittedly, I'm not sure whether Record support has made it into the release (1.1.1) version of JNoSQL or if it's still in the works, so it may be that this will improve in time outside of this project.

@jesse-gallagher
Copy link
Member Author

There were a few things going on. Beyond the first two fixes enumerated there, JNoSQL's DefaultConstructorBuilder needed to have its addEmptyParameter method changed to account for primitive values. Beyond that, Expressly (the EL implementation) doesn't yet support Records, so I added a resolver and applied it to the XPages and Pages contexts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working nosql
Projects
None yet
Development

No branches or pull requests

1 participant