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

Improves Query Condition to Document and Column #77

Merged
merged 18 commits into from
Jan 17, 2017
Merged

Conversation

otaviojava
Copy link
Member

@otaviojava otaviojava commented Jan 17, 2017

The proposal creates some improvements on a query to both, Column and Document types. So the idea is to create a mechanism to do a conditional query:
Ex:

Column age = Column.of("age", 26);
Column name = Column.of("name", "otavio");
ColumnCondition condition = ColumnCondition.eq(name).and(ColumnCondition.gte(age));

or:

ColumnCondition condition = ColumnCondition.eq(name).negate();

Following some databases, we will create reserved words, keywords, to each condition on org.jnosql.Condition enum. The formula is underscore plus condition name sensitive case.
So,

Column age = Column.of("age", 26);
 Column name = Column.of("name", "otavio");
ColumnCondition condition = ColumnCondition.eq(name).and(ColumnCondition.gte(age));

Will result from a Column that gonna have:
"_AND" as key and then a list these two conditions, name equals otavio and age greater or equals to 26.

Or:

ColumnCondition condition = ColumnCondition.eq(name).negate();

That will result in a documentation where the key is:
"_NOT" and the value gonna be the condition.

@otaviojava otaviojava merged commit f69329c into master Jan 17, 2017
@otaviojava otaviojava deleted the condition branch January 17, 2017 18:23
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

Successfully merging this pull request may close these issues.

None yet

1 participant