Esempio n. 1
0
  public static boolean hasRelations(RelationQuery query) {

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

    return true;
  }
Esempio n. 2
0
  public static boolean hasExcludedFields(RelationQuery query) {

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

    return true;
  }
Esempio n. 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();
  }
Esempio n. 4
0
  public void addExcludedFields(RelationQuery relationQuery) {

    if (hasExcludedFields(relationQuery)) {

      this.addExcludedFields(relationQuery.getExcludedFields());
    }
  }
Esempio n. 5
0
  public void addRelations(RelationQuery relationQuery) {

    if (hasRelations(relationQuery)) {

      this.addRelations(relationQuery.getRelations());
    }
  }
Esempio n. 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;
  }