Skip to content

Commit

Permalink
Merge branch 'release/v2.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
bot committed Aug 9, 2023
2 parents b48cc3f + a2b5757 commit 4030b4f
Show file tree
Hide file tree
Showing 57 changed files with 894 additions and 250 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

Note: version releases in the 0.x.y range may introduce breaking changes.

## [2.1.0]
### Added
- Added json Serialisation for the AQL-DTO model ([#496](https://github.com/ehrbase/openEHR_SDK/pull/496))
### Fixed

## [2.0.0]

### Added
Expand Down Expand Up @@ -323,3 +328,4 @@ Note: version releases in the 0.x.y range may introduce breaking changes.
[1.29.0]: https://github.com/ehrbase/openEHR_SDK/compare/v1.28.0...v1.29.0

[2.0.0]: https://github.com/ehrbase/openEHR_SDK/compare/v1.29.0...v2.0.0
[2.1.0]: https://github.com/ehrbase/openEHR_SDK/compare/v2.0.0...v2.1.0
2 changes: 1 addition & 1 deletion aql/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<parent>
<groupId>org.ehrbase.openehr.sdk</groupId>
<artifactId>sdk-parent</artifactId>
<version>2.0.0</version>
<version>2.1.0</version>
</parent>

<artifactId>aql</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ selectExpr
;

fromExpr
: containsExpr
: classExprOperand (NOT? CONTAINS containsExpr)?
| SYM_LEFT_PAREN fromExpr SYM_RIGHT_PAREN
;

whereExpr
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
*/
package org.ehrbase.openehr.sdk.aql.dto.condition;

import java.util.Objects;
import org.ehrbase.openehr.sdk.aql.dto.operand.ComparisonLeftOperand;
import org.ehrbase.openehr.sdk.aql.dto.operand.Operand;

Expand Down Expand Up @@ -50,46 +51,24 @@ public void setValue(Operand value) {
this.value = value;
}

public boolean equals(final Object o) {
if (o == this) return true;
if (!(o instanceof ComparisonOperatorCondition)) return false;
final ComparisonOperatorCondition other = (ComparisonOperatorCondition) o;
if (!other.canEqual((Object) this)) return false;
final Object this$statement = this.getStatement();
final Object other$statement = other.getStatement();
if (this$statement == null ? other$statement != null : !this$statement.equals(other$statement)) return false;
final Object this$symbol = this.getSymbol();
final Object other$symbol = other.getSymbol();
if (this$symbol == null ? other$symbol != null : !this$symbol.equals(other$symbol)) return false;
final Object this$value = this.getValue();
final Object other$value = other.getValue();
if (this$value == null ? other$value != null : !this$value.equals(other$value)) return false;
return true;
}

protected boolean canEqual(final Object other) {
return other instanceof ComparisonOperatorCondition;
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
ComparisonOperatorCondition that = (ComparisonOperatorCondition) o;
return Objects.equals(statement, that.statement) && symbol == that.symbol && Objects.equals(value, that.value);
}

@Override
public int hashCode() {
final int PRIME = 59;
int result = 1;
final Object $statement = this.getStatement();
result = result * PRIME + ($statement == null ? 43 : $statement.hashCode());
final Object $symbol = this.getSymbol();
result = result * PRIME + ($symbol == null ? 43 : $symbol.hashCode());
final Object $value = this.getValue();
result = result * PRIME + ($value == null ? 43 : $value.hashCode());
return result;
return Objects.hash(statement, symbol, value);
}

@Override
public String toString() {
return "ComparisonOperatorCondition(statement="
+ this.getStatement()
+ ", symbol="
+ this.getSymbol()
+ ", value="
+ this.getValue()
+ ")";
return "ComparisonOperatorCondition{" + "statement="
+ statement + ", symbol="
+ symbol + ", value="
+ value + '}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,10 @@ public void setValue(IdentifiedPath value) {
this.value = value;
}

@Override
public String toString() {
return "ExistsCondition{" + "value=" + value + '}';
}

@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
ExistsCondition that = (ExistsCondition) o;
return Objects.equals(value, that.value);
}
Expand All @@ -62,4 +53,9 @@ public boolean equals(Object o) {
public int hashCode() {
return Objects.hash(value);
}

@Override
public String toString() {
return "ExistsCondition{" + "value=" + value + '}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
*/
package org.ehrbase.openehr.sdk.aql.dto.condition;

import java.util.Objects;
import org.ehrbase.openehr.sdk.aql.dto.operand.IdentifiedPath;
import org.ehrbase.openehr.sdk.aql.dto.operand.LikeOperand;

Expand All @@ -42,35 +43,21 @@ public void setValue(LikeOperand value) {
this.value = value;
}

public boolean equals(final Object o) {
if (o == this) return true;
if (!(o instanceof LikeCondition)) return false;
final LikeCondition other = (LikeCondition) o;
if (!other.canEqual((Object) this)) return false;
final Object this$statement = this.getStatement();
final Object other$statement = other.getStatement();
if (this$statement == null ? other$statement != null : !this$statement.equals(other$statement)) return false;
final Object this$value = this.getValue();
final Object other$value = other.getValue();
if (this$value == null ? other$value != null : !this$value.equals(other$value)) return false;
return true;
}

protected boolean canEqual(final Object other) {
return other instanceof LikeCondition;
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
LikeCondition that = (LikeCondition) o;
return Objects.equals(statement, that.statement) && Objects.equals(value, that.value);
}

@Override
public int hashCode() {
final int PRIME = 59;
int result = 1;
final Object $statement = this.getStatement();
result = result * PRIME + ($statement == null ? 43 : $statement.hashCode());
final Object $value = this.getValue();
result = result * PRIME + ($value == null ? 43 : $value.hashCode());
return result;
return Objects.hash(statement, value);
}

@Override
public String toString() {
return "LikeCondition(statement=" + this.getStatement() + ", value=" + this.getValue() + ")";
return "LikeCondition{" + "statement=" + statement + ", value=" + value + '}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package org.ehrbase.openehr.sdk.aql.dto.condition;

import java.util.List;
import java.util.Objects;
import org.ehrbase.openehr.sdk.aql.dto.LogicalOperator;
import org.ehrbase.openehr.sdk.aql.dto.condition.LogicalOperatorCondition.ConditionLogicalOperatorSymbol;

Expand Down Expand Up @@ -45,36 +46,22 @@ public void setValues(List<WhereCondition> values) {
this.values = values;
}

public boolean equals(final Object o) {
if (o == this) return true;
if (!(o instanceof LogicalOperatorCondition)) return false;
final LogicalOperatorCondition other = (LogicalOperatorCondition) o;
if (!other.canEqual((Object) this)) return false;
final Object this$symbol = this.getSymbol();
final Object other$symbol = other.getSymbol();
if (this$symbol == null ? other$symbol != null : !this$symbol.equals(other$symbol)) return false;
final Object this$values = this.getValues();
final Object other$values = other.getValues();
if (this$values == null ? other$values != null : !this$values.equals(other$values)) return false;
return true;
}

protected boolean canEqual(final Object other) {
return other instanceof LogicalOperatorCondition;
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
LogicalOperatorCondition that = (LogicalOperatorCondition) o;
return symbol == that.symbol && Objects.equals(values, that.values);
}

@Override
public int hashCode() {
final int PRIME = 59;
int result = 1;
final Object $symbol = this.getSymbol();
result = result * PRIME + ($symbol == null ? 43 : $symbol.hashCode());
final Object $values = this.getValues();
result = result * PRIME + ($values == null ? 43 : $values.hashCode());
return result;
return Objects.hash(symbol, values);
}

@Override
public String toString() {
return "LogicalOperatorCondition(symbol=" + this.getSymbol() + ", values=" + this.getValues() + ")";
return "LogicalOperatorCondition{" + "symbol=" + symbol + ", values=" + values + '}';
}

public enum ConditionLogicalOperatorSymbol {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,10 @@ public void setConditionDto(WhereCondition condition) {
this.condition = condition;
}

@Override
public String toString() {
return "NotCondition{" + "condition=" + condition + '}';
}

@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
NotCondition that = (NotCondition) o;
return Objects.equals(condition, that.condition);
}
Expand All @@ -61,4 +52,9 @@ public boolean equals(Object o) {
public int hashCode() {
return Objects.hash(condition);
}

@Override
public String toString() {
return "NotCondition{" + "condition=" + condition + '}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "_type")
@JsonSubTypes({
@JsonSubTypes.Type(value = ComparisonOperatorCondition.class, name = "ComparisonOperator"),
@JsonSubTypes.Type(value = LogicalOperatorCondition.class, name = "LogicalOperator")
@JsonSubTypes.Type(value = LogicalOperatorCondition.class, name = "LogicalOperator"),
@JsonSubTypes.Type(value = ExistsCondition.class, name = "Exists"),
@JsonSubTypes.Type(value = LikeCondition.class, name = "Like"),
@JsonSubTypes.Type(value = MatchesCondition.class, name = "Matches"),
@JsonSubTypes.Type(value = NotCondition.class, name = "Not")
})
public interface WhereCondition {}
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,15 @@
* limitations under the License.
*/
package org.ehrbase.openehr.sdk.aql.dto.containment;

import com.fasterxml.jackson.annotation.JsonIdentityInfo;
import com.fasterxml.jackson.annotation.ObjectIdGenerators;
import java.util.Objects;

/**
* @author Stefan Spiska
*/
@JsonIdentityInfo(generator = ObjectIdGenerators.PropertyGenerator.class, property = "identifier")
public abstract class AbstractContainmentExpression implements Containment {

private Containment contains;
Expand All @@ -40,4 +46,22 @@ public String getIdentifier() {
public void setIdentifier(String identifier) {
this.identifier = identifier;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
AbstractContainmentExpression that = (AbstractContainmentExpression) o;
return Objects.equals(contains, that.contains) && Objects.equals(identifier, that.identifier);
}

@Override
public int hashCode() {
return Objects.hash(contains, identifier);
}

@Override
public String toString() {
return "AbstractContainmentExpression{" + "contains=" + contains + ", identifier='" + identifier + '\'' + '}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,14 @@
*/
package org.ehrbase.openehr.sdk.aql.dto.containment;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import org.ehrbase.openehr.sdk.aql.dto.path.AndOperatorPredicate;
import org.ehrbase.openehr.sdk.aql.serializer.PredicateDeserializer;
import org.ehrbase.openehr.sdk.aql.serializer.PredicateSerializer;

public class ContainmentClassExpression extends AbstractContainmentExpression {

Expand All @@ -35,11 +40,35 @@ public void setType(String type) {
this.type = type;
}

@JsonSerialize(using = PredicateSerializer.class)
public List<AndOperatorPredicate> getPredicates() {
return predicates;
}

@JsonDeserialize(using = PredicateDeserializer.class)
public void setPredicates(List<AndOperatorPredicate> predicates) {
this.predicates = new ArrayList<>(predicates);
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
ContainmentClassExpression that = (ContainmentClassExpression) o;
return Objects.equals(type, that.type) && Objects.equals(predicates, that.predicates);
}

@Override
public int hashCode() {
return Objects.hash(super.hashCode(), type, predicates);
}

@Override
public String toString() {
return "ContainmentClassExpression{" + "type='"
+ type + '\'' + ", predicates="
+ predicates + "} "
+ super.toString();
}
}
Loading

0 comments on commit 4030b4f

Please sign in to comment.