diff --git a/infra/schema/src/main/java/com/evolveum/midpoint/schema/GetOperationOptions.java b/infra/schema/src/main/java/com/evolveum/midpoint/schema/GetOperationOptions.java index 50810f95516..600264bade2 100644 --- a/infra/schema/src/main/java/com/evolveum/midpoint/schema/GetOperationOptions.java +++ b/infra/schema/src/main/java/com/evolveum/midpoint/schema/GetOperationOptions.java @@ -258,36 +258,47 @@ public Boolean getAllowNotFound() { return allowNotFound; } - public void setAllowNotFound(Boolean allowNotFound) { - this.allowNotFound = allowNotFound; - } - - public static boolean isAllowNotFound(GetOperationOptions options) { - if (options == null) { - return false; - } - if (options.allowNotFound == null) { - return false; - } - return options.allowNotFound; + public void setAllowNotFound(Boolean allowNotFound) { + this.allowNotFound = allowNotFound; + } + + public static boolean isAllowNotFound(GetOperationOptions options) { + if (options == null) { + return false; } - - public static GetOperationOptions createDoNotDiscovery() { - GetOperationOptions opts = new GetOperationOptions(); - opts.setDoNotDiscovery(true); - return opts; + if (options.allowNotFound == null) { + return false; } + return options.allowNotFound; + } + + public static GetOperationOptions createDoNotDiscovery() { + GetOperationOptions opts = new GetOperationOptions(); + opts.setDoNotDiscovery(true); + return opts; + } + + public RelationalValueSearchQuery getRelationalValueSearchQuery() { + return relationalValueSearchQuery; + } + public void setRelationalValueSearchQuery(RelationalValueSearchQuery relationalValueSearchQuery) { + this.relationalValueSearchQuery = relationalValueSearchQuery; + } - @Override + @Override public int hashCode() { final int prime = 31; int result = 1; + result = prime * result + ((allowNotFound == null) ? 0 : allowNotFound.hashCode()); + result = prime * result + ((doNotDiscovery == null) ? 0 : doNotDiscovery.hashCode()); result = prime * result + ((noFetch == null) ? 0 : noFetch.hashCode()); result = prime * result + ((raw == null) ? 0 : raw.hashCode()); + result = prime * result + + ((relationalValueSearchQuery == null) ? 0 : relationalValueSearchQuery.hashCode()); result = prime * result + ((resolve == null) ? 0 : resolve.hashCode()); - result = prime * result + ((doNotDiscovery == null) ? 0 : doNotDiscovery.hashCode()); - result = prime * result + ((allowNotFound == null) ? 0 : allowNotFound.hashCode()); + result = prime * result + ((resolveNames == null) ? 0 : resolveNames.hashCode()); + result = prime * result + ((retrieve == null) ? 0 : retrieve.hashCode()); return result; } @@ -300,6 +311,16 @@ public boolean equals(Object obj) { if (getClass() != obj.getClass()) return false; GetOperationOptions other = (GetOperationOptions) obj; + if (allowNotFound == null) { + if (other.allowNotFound != null) + return false; + } else if (!allowNotFound.equals(other.allowNotFound)) + return false; + if (doNotDiscovery == null) { + if (other.doNotDiscovery != null) + return false; + } else if (!doNotDiscovery.equals(other.doNotDiscovery)) + return false; if (noFetch == null) { if (other.noFetch != null) return false; @@ -310,30 +331,27 @@ public boolean equals(Object obj) { return false; } else if (!raw.equals(other.raw)) return false; + if (relationalValueSearchQuery == null) { + if (other.relationalValueSearchQuery != null) + return false; + } else if (!relationalValueSearchQuery.equals(other.relationalValueSearchQuery)) + return false; if (resolve == null) { if (other.resolve != null) return false; } else if (!resolve.equals(other.resolve)) return false; - if (doNotDiscovery == null) { - if (other.doNotDiscovery != null) + if (resolveNames == null) { + if (other.resolveNames != null) return false; - } else if (!doNotDiscovery.equals(other.doNotDiscovery)) + } else if (!resolveNames.equals(other.resolveNames)) return false; - - if (allowNotFound == null) { - if (other.allowNotFound != null) - return false; - } else if (!allowNotFound.equals(other.allowNotFound)) + if (retrieve != other.retrieve) return false; - - if (retrieve != null ? !retrieve.equals(other.retrieve) : other.retrieve != null) - return false; - return true; } - public GetOperationOptions clone() { + public GetOperationOptions clone() { GetOperationOptions clone = new GetOperationOptions(); clone.noFetch = this.noFetch; clone.doNotDiscovery = this.doNotDiscovery; @@ -342,13 +360,17 @@ public GetOperationOptions clone() { clone.resolveNames = this.resolveNames; clone.retrieve = this.retrieve; clone.allowNotFound = this.allowNotFound; + if (this.relationalValueSearchQuery != null) { + clone.relationalValueSearchQuery = this.relationalValueSearchQuery.clone(); + } return clone; } @Override public String toString() { return "GetOperationOptions(resolve=" + resolve + ", resolveNames=" + resolveNames + ",noFetch=" + noFetch - + ", raw=" + raw + ", doNotDiscovery="+doNotDiscovery+", retrieve="+retrieve+", allowNotFound="+ allowNotFound +")"; + + ", raw=" + raw + ", doNotDiscovery="+doNotDiscovery+", retrieve="+retrieve+", allowNotFound="+ allowNotFound + +", relationalValueSearchQuery="+relationalValueSearchQuery+")"; } } diff --git a/infra/schema/src/main/java/com/evolveum/midpoint/schema/RelationalValueSearchQuery.java b/infra/schema/src/main/java/com/evolveum/midpoint/schema/RelationalValueSearchQuery.java index 529cb0881f1..15c8f7bfdd2 100644 --- a/infra/schema/src/main/java/com/evolveum/midpoint/schema/RelationalValueSearchQuery.java +++ b/infra/schema/src/main/java/com/evolveum/midpoint/schema/RelationalValueSearchQuery.java @@ -45,6 +45,46 @@ public RelationalValueSearchQuery(QName column, String searchValue, RelationalVa this.searchType = searchType; } + public QName getColumn() { + return column; + } + + public void setColumn(QName column) { + this.column = column; + } + + public String getSearchValue() { + return searchValue; + } + + public void setSearchValue(String searchValue) { + this.searchValue = searchValue; + } + + public RelationalValueSearchType getSearchType() { + return searchType; + } + + public void setSearchType(RelationalValueSearchType searchType) { + this.searchType = searchType; + } + + public ObjectPaging getPaging() { + return paging; + } + + public void setPaging(ObjectPaging paging) { + this.paging = paging; + } + + public RelationalValueSearchQuery clone() { + RelationalValueSearchQuery clone = new RelationalValueSearchQuery(column, searchValue, searchType); + if (this.paging != null) { + clone.paging = this.paging.clone(); + } + return clone; + } + @Override public int hashCode() { final int prime = 31;