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

Missing operators in DocumentCondition #99

Closed
amoscatelli opened this issue Jun 5, 2022 · 19 comments
Closed

Missing operators in DocumentCondition #99

amoscatelli opened this issue Jun 5, 2022 · 19 comments

Comments

@amoscatelli
Copy link

amoscatelli commented Jun 5, 2022

Hi @otaviojava
Let's keep track of the missing operators / functionalities to extend yours DocumentCondition (#90) with :

  1. 'Not' operator. Basic negation operator, I believe every nosql databases supports it (for sure it's supported by MongoDB and ElasticSearch).

  2. InclusiveBetween + ExclusiveBetween VS Between. Same as before, also we already talked about this.

  3. Allowing a 'path' on the 'Right hand side'. This is the hardest one, we need to find a way to represent a 'path' and allowing DocumentCondition operators to accept that path as a RHS. For example this allows making queries like 'retrieve every movie where critics score is higher than odience score'. You told me this is not supported at the moment so we need to work on this. If I recall correctly, both mongodb and elasticsearch support this out of the box.

What do you think ?

@otaviojava
Copy link
Contributor

otaviojava commented Jun 9, 2022

We have the negate negate method to Not operator.

@otaviojava
Copy link
Contributor

I've created this PR to add the no method following the Java API:
#100

@amoscatelli
Copy link
Author

We have the negate negate method to Not operator.

oh ! that's good enough, sorry. I missed that.

Point n1 is to be considered fixed.

@amoscatelli
Copy link
Author

@otaviojava correcly integrated on the fly !
eclipse/jnosql-extensions@67e4517

@amoscatelli
Copy link
Author

@otaviojava what bout point n2 and n3 ? how can we proceed ?

@amoscatelli
Copy link
Author

Hi @otaviojava !
Any news to make this progress ?

@otaviojava
Copy link
Contributor

Sorry for the delay.
For now, let's keep it.
We'll work in parallel with the Jakarta Data:
https://projects.eclipse.org/proposals/jakarta-data

So, what we can do is create some utilitarian classes to cover it.
We can start on MongoDB to mature more the proposal.

What do you think?

@amoscatelli
Copy link
Author

I can't really understand which are the functionalities to be modeled in jakarta-data that we may cover/use here.
You have fore sure a more complete view than me so just tell me more details on what do you have in mind and let's move forward 💪.

Let's just not forget the final goal : having a complete query builder for JNoSql, with update and delete support too !

Now, what do we do ?

@otaviojava
Copy link
Contributor

How about improving the MongoDB extension?
right now, we have new dependencies:
https://github.com/eclipse/jnosql-mapping-extension/blob/master/jnosql-mongodb-extension/pom.xml

What do you think if we move it as a dependency in build time?

@amoscatelli
Copy link
Author

Maybe we can have a call and talk about this ?
I believe I am not following you.

I added these two new dependencies :

        <dependency>
            <groupId>com.google.auto.service</groupId>
            <artifactId>auto-service</artifactId>
            <version>1.0.1</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>com.sun.codemodel</groupId>
            <artifactId>codemodel</artifactId>
            <version>2.6</version>
            <scope>compile</scope>
        </dependency>

Are talking about both of them ?

@amoscatelli
Copy link
Author

Anyway yes @otaviojava, auto-service can be flagged as a compile time only dependency.

@otaviojava
Copy link
Contributor

Yeap, if we put those as an option it would be really nice.

@amoscatelli
Copy link
Author

amoscatelli commented Jul 5, 2022

@otaviojava here you are :
eclipse/jnosql-extensions@1e1ba42

BUT we can't flag com.sun.codemodel as optional, it is a required transitive dependency.
What we can do, is to migrate the whole metamodel generation code to another library.
This is the same decision Hibernate team also made, the metamodel generator is a separate jar.

What do you think ?

@otaviojava
Copy link
Contributor

I like it.

Cassandra Mapper has a similar strategy with an annotation processor:

https://docs.datastax.com/en/developer/java-driver/4.2/manual/mapper/config/

@amoscatelli
Copy link
Author

amoscatelli commented Jul 5, 2022

At the beginning, when my code was still in the main jnosql api and impl libraries, metamodel generator was indeed already a separate library.

Inside mapping extensions, how do you suggest to proceed ?
Hybernate metamodel dependency is called 'hibernate-jpamodelgen', Cassandra's is called 'java-driver-mapper-processor'.

Maybe a 'jnosql-metamodel-generator-extension' ?
Or 'jnosql-metamodel-processor-extension' ?

@otaviojava
Copy link
Contributor

I like the jnosql-metamodel-processor-extension

@amoscatelli
Copy link
Author

@otaviojava
done :
eclipse/jnosql-extensions@master...amoscatelli:jnosql-mapping-extension:master

is this good ?
may I also suggest to move criteria packages to a 'jnosql-criteria-extension' ?
what do you think ?

@amoscatelli
Copy link
Author

amoscatelli commented Jul 23, 2022

Hi @otaviojava
I made a pull request for what we agreed upon :
eclipse/jnosql-extensions#64

I would like to start moving criteria packages to jnosql-criteria-extension but I need to know what you think about it

@otaviojava
Copy link
Contributor

Hey @amoscatelli, we removed the communication here.

So, I'll close this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants