-
Notifications
You must be signed in to change notification settings - Fork 31
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
Query on Field Type Limitations within jakarta.data.metamodel Package and Its Impact on Extensibility[clarification]: #560
Comments
I think it's at least a little bit hard to have this discussion without getting into the specifics of how we plan to use the metamodel to express restrictions. That's something we're not addressing that in JD 1.0, and so we have done something very minimal with the metamodel. But there are at least two approaches, I guess:
The passage you indicate leaves us free to take route 2 in the future, without breaking client code. And providers which wish to provide this functionality today, as an extension, can do it via approach 1, which is more general, if also more verbose. On the other hand, if we open the door too wide to providers introducing their own extensions like So I would say this is OK for now. It's something we know we're going to come back to after 1.0. |
The challenge here is that we are talking about cross-databases. Thus, some queries make sense on one side but not on the other. For example, only Graph databases have direction in their relationship, and given a provider that uses Apache Tinkerpop, it might introduce this: _person.outE("knows").("how", "social-media"); It only makes sense to an Apache Tinkerpop Graph database provider, and it won´t make sense to become a standard; this is super specific. I am not talking about introducing it now but allowing vendors to explore this extensibility, even if the spec does not guarantee the behavior or compatibility among vendors. |
So then that would seem to argue in favor of a builder-style approach, no? That way, each data store type has its own dedicated builder with the operations it supports. |
Wait, wait, what I said here is wrong:
In fact, that's not true today, because So to make code like the above typesafe, we do need to introduce either:
Fortunately, we just don't have many types, due to the inherent limitations on what Jakarta Data is trying to achieve. Scanning the sort of operations we have in JDQL today, it looks to me like only But of course if we wish to accommodate vendor extensions, as you suggest, and assuming we didn't introduce But anyway this really starts to get into the weeds of stuff we're not doing in 1.0. I think it's best that we leave this alone for now, so that we can introduce such subtypes in Jakarta Data 1.1. |
Yeap, I will put the the Jakarta Data Future label. |
Specification
https://github.com/jakartaee/data/blob/main/spec/src/main/asciidoc/repository.asciidoc#type-safe-access-to-entity-attributes
I need clarification on ...
Hello,
I'm reaching out to discuss and understand the specific rationale behind the field type restrictions outlined in the documentation/specification, which states:
This constraint limits the model's extensibility, especially when attempting to develop specializations that accommodate various criteria conditions, such as those applicable to NoSQL databases.
For context, I want to create specialized attributes that could directly handle more granular query logic within the type system. An example of such a specialization might be:
And applying this to an entity like this:
My goal is to enable more expressive queries directly through the metamodel, such as:
However, the restriction above prevents the implementation of such extensions, potentially limiting the framework's utility for complex or specialized use cases.
Additional information
No response
The text was updated successfully, but these errors were encountered: