예제 #1
0
  public static boolean hasRelations(RelationQuery query) {

    if (query == null || query.getRelations() == null || query.getRelations().isEmpty()) {
      return false;
    }

    return true;
  }
예제 #2
0
  public static boolean hasExcludedFields(RelationQuery query) {

    if (query == null || query.getExcludedFields() == null || query.getExcludedFields().isEmpty()) {
      return false;
    }

    return true;
  }
예제 #3
0
  public RelationQuery(RelationQuery relationQuery) {

    if (relationQuery == null) {

      return;
    }

    this.addRelations(relationQuery);
    this.addExcludedRelations(relationQuery);
    this.addExcludedFields(relationQuery);
    this.disableAutoRelations(relationQuery.isDisableAutoRelations());
    this.relationParameterHandler = relationQuery.getRelationParameterHandler();
    this.relationOrderByHandler = relationQuery.getRelationOrderByHandler();
    this.relationRowLimiterHandler = relationQuery.getRelationRowLimiterHandler();
  }
예제 #4
0
  public void addExcludedFields(RelationQuery relationQuery) {

    if (hasExcludedFields(relationQuery)) {

      this.addExcludedFields(relationQuery.getExcludedFields());
    }
  }
예제 #5
0
  public void addRelations(RelationQuery relationQuery) {

    if (hasRelations(relationQuery)) {

      this.addRelations(relationQuery.getRelations());
    }
  }
예제 #6
0
  @Override
  public RelationQuery clone() throws CloneNotSupportedException {

    RelationQuery clone = (RelationQuery) super.clone();

    if (this.excludedFields != null) {

      clone.excludedFields = new ArrayList<Field>(excludedFields);
    }

    if (this.excludedRelations != null) {

      clone.excludedRelations = new ArrayList<Field>(excludedRelations);
    }

    if (this.relations != null) {

      clone.relations = new ArrayList<Field>(relations);
    }

    return clone;
  }