code: public List<ExtendedRelation> getRelations(String baseTable,
  			String baseColumn, String relatedTable, String relatedColumn,
  			String relation, String mappingTable) throws SQLException {
  
  		QueryBuilder<ExtendedRelation, Long> qb = queryBuilder();
  		Where<ExtendedRelation, Long> where = null;
  
  		if (baseTable != null) {
  			where = addToWhere(qb, where);
  			where.like(ExtendedRelation.COLUMN_BASE_TABLE_NAME, baseTable);
  		}
  
  		if (baseColumn != null) {
  			where = addToWhere(qb, where);
  			where.like(ExtendedRelation.COLUMN_BASE_PRIMARY_COLUMN, baseColumn);
  		}
  
  		if (relatedTable != null) {
  			where = addToWhere(qb, where);
  			where.like(ExtendedRelation.COLUMN_RELATED_TABLE_NAME, relatedTable);
  		}
  
  		if (relatedColumn != null) {
  			where = addToWhere(qb, where);
  			where.like(ExtendedRelation.COLUMN_RELATED_PRIMARY_COLUMN,
  					relatedColumn);
  		}
  
  		if (relation != null) {
  			where = addToWhere(qb, where);
  			where.like(ExtendedRelation.COLUMN_RELATION_NAME, relation);
  		}
  
  		if (mappingTable != null) {
  			where = addToWhere(qb, where);
  			where.like(ExtendedRelation.COLUMN_MAPPING_TABLE_NAME, mappingTable);
  		}
  
  		PreparedQuery<ExtendedRelation> preparedQuery = qb.prepare();
  
  		return query(preparedQuery);
  	}
docs: Get the relations matching the non null provided values
  
  @param baseTable
  base table name
  @param baseColumn
  base primary column name
  @param relatedTable
  related table name
  @param relatedColumn
  related primary column name
  @param relation
  relation name
  @param mappingTable
  mapping table name
  @return extended relations
  @throws SQLException
  upon failure
  @since 3.2.0