org.eclipse.persistence.jpa.jpql.parser.WhereClause.getConditionalExpression()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(8.5k)|赞(0)|评价(0)|浏览(137)

本文整理了Java中org.eclipse.persistence.jpa.jpql.parser.WhereClause.getConditionalExpression()方法的一些代码示例,展示了WhereClause.getConditionalExpression()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WhereClause.getConditionalExpression()方法的具体详情如下:
包路径:org.eclipse.persistence.jpa.jpql.parser.WhereClause
类名称:WhereClause
方法名:getConditionalExpression

WhereClause.getConditionalExpression介绍

暂无

代码示例

代码示例来源:origin: Impetus/Kundera

/**
 * Sets the filters from where clause.
 * 
 * @param query
 *            the query
 * @param m
 *            the m
 * @param useLuceneOrES
 *            the use lucene or es
 * @return the filters from where clause
 */
private Filter getFiltersFromWhereClause(KunderaQuery query, EntityMetadata m, Boolean useLuceneOrES)
{
  String idColumn = ((AbstractAttribute) m.getIdAttribute()).getJPAColumnName();
  WhereClause whereClause = KunderaQueryUtils.getWhereClause(query.getJpqlExpression());
  if (whereClause != null)
  {
    this.isWhereOrAggregation = true;
    if (!useLuceneOrES)
      return traverse(whereClause.getConditionalExpression(), m, idColumn);
  }
  return null;
}

代码示例来源:origin: Impetus/Kundera

/**
 * Inits the filter.
 */
private void initFilter() {
  EntityMetadata metadata = KunderaMetadataManager.getEntityMetadata(kunderaMetadata, entityClass);
  Metamodel metaModel = kunderaMetadata.getApplicationMetadata().getMetamodel(getPersistenceUnit());
  EntityType entityType = metaModel.entity(entityClass);
  if (null == filter) {
    List<String> clauses = new ArrayList<String>();
    addDiscriminatorClause(clauses, entityType);
    return;
  }
  WhereClause whereClause = KunderaQueryUtils.getWhereClause(getJpqlExpression());
  KunderaQueryUtils.traverse(whereClause.getConditionalExpression(), metadata, kunderaMetadata, this, false);
  for (Object filterClause : filtersQueue) {
    if (!(filterClause instanceof String)) {
      onTypedParameter(((FilterClause) filterClause));
    }
  }
  addDiscriminatorClause(null, entityType);
}

代码示例来源:origin: Impetus/Kundera

@Override
protected List<Object> populateEntities(EntityMetadata m, Client client)
{
  MetamodelImpl metaModel = (MetamodelImpl) kunderaMetadata.getApplicationMetadata().getMetamodel(
      m.getPersistenceUnit());
  EntityType entity = metaModel.entity(m.getEntityClazz());
  Expression whereExpression = KunderaQueryUtils.getWhereClause(kunderaQuery.getJpqlExpression());
  QueryBuilder filter = whereExpression == null || whereExpression instanceof NullExpression ? null
      : esFilterBuilder.populateFilterBuilder(((WhereClause) whereExpression).getConditionalExpression(), m);
  return ((ESClient) client).executeQuery(filter, buildAggregation(kunderaQuery, m, filter), m,
      getKunderaQuery(),this.firstResult, this.maxResult);
}

代码示例来源:origin: Impetus/Kundera

/**
 * Compile where.
 */
private void compileWhere()
{
  WhereClause whereClause = null;
  if (query.isSelectStatement())
  {
    whereClause = (WhereClause) query.getSelectStatement().getWhereClause();
  }
  else if (query.isUpdateStatement())
  {
    whereClause = (WhereClause) query.getUpdateStatement().getWhereClause();
  }
  if (query.isDeleteStatement())
  {
    whereClause = (WhereClause) query.getDeleteStatement().getWhereClause();
  }
  String content = whereClause.getConditionalExpression().toActualText();
  if (whereClause != null && content.length() == 0)
  {
    throw new JPQLParseException("keyword without value[WHERE]");
  }
  query.setFilter(content);
}

代码示例来源:origin: Impetus/Kundera

@Override
public Map<String, Object> search(KunderaMetadata kunderaMetadata, KunderaQuery kunderaQuery,
    PersistenceDelegator persistenceDelegator, EntityMetadata m, int firstResult, int maxResults)
{
  ESQuery query = new ESQuery<>(kunderaQuery, persistenceDelegator, kunderaMetadata);
  MetamodelImpl metaModel = (MetamodelImpl) kunderaMetadata.getApplicationMetadata()
      .getMetamodel(m.getPersistenceUnit());
  Expression whereExpression = KunderaQueryUtils.getWhereClause(kunderaQuery.getJpqlExpression());
  QueryBuilder filter = whereExpression != null ? query.getEsFilterBuilder()
      .populateFilterBuilder(((WhereClause) whereExpression).getConditionalExpression(), m) : null;
  FilteredQueryBuilder queryBuilder = QueryBuilders.filteredQuery(null, filter);
  SearchResponse response = getSearchResponse(kunderaQuery, queryBuilder, filter, query, m, firstResult,
      maxResults, kunderaMetadata);
  return buildResultMap(response, kunderaQuery, m, metaModel);
}

代码示例来源:origin: Impetus/Kundera

Expression whereExp = whereClause.getConditionalExpression();

代码示例来源:origin: Impetus/Kundera

Expression whereExp = whereClause.getConditionalExpression();
filter = table.filter(parseAndBuildFilters(entityType, whereExp));

代码示例来源:origin: Impetus/Kundera

Expression whereExp = whereClause.getConditionalExpression();
parseAndBuildFilters(entityType, scannerBuilder, whereExp);

代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.jpa.jpql

/**
   * {@inheritDoc}
   */
  @Override
  public void visit(WhereClause expression) {
    clause = WHERE;
    expression.getConditionalExpression().accept(this);
    clause = null;
  }
}

代码示例来源:origin: com.haulmont.thirdparty/eclipselink

/**
 * {@inheritDoc}
 */
@Override
public void visit(WhereClause expression) {
  expression.getConditionalExpression().accept(this);
}

代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * {@inheritDoc}
 */
@Override
public void visit(WhereClause expression) {
  expression.getConditionalExpression().accept(this);
}

代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.jpa.jpql

/**
 * {@inheritDoc}
 */
public void visit(WhereClause expression) {
  expression.getConditionalExpression().accept(this);
}

代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.jpa.jpql

/**
 * {@inheritDoc}
 */
@Override
public void visit(WhereClause expression) {
  expression.getConditionalExpression().accept(this);
}

代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * {@inheritDoc}
 */
@Override
public void visit(WhereClause expression) {
  expression.getConditionalExpression().accept(this);
}

代码示例来源:origin: com.haulmont.thirdparty/eclipselink

/**
 * {@inheritDoc}
 */
@Override
public void visit(WhereClause expression) {
  expression.getConditionalExpression().accept(this);
}

代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.jpa.jpql

/**
   * {@inheritDoc}
   */
  @Override
  public void visit(WhereClause expression) {
    if (expression.hasConditionalExpression()) {
      conditionalExpression = true;
      expression.getConditionalExpression().accept(this);
      conditionalExpression = false;
    }
  }
}

代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.jpa.jpql

/**
   * {@inheritDoc}
   */
  @Override
  public void visit(WhereClause expression) {
    WhereClauseStateObject whereClause = stateObject.addWhereClause();
    whereClause.setExpression(expression);
    expression.getConditionalExpression().accept(BasicStateObjectBuilder.this);
    StateObject conditionalStateObject = BasicStateObjectBuilder.this.stateObject;
    whereClause.setConditional(conditionalStateObject);
  }
}

代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.jpa.jpql

/**
   * {@inheritDoc}
   */
  @Override
  public void visit(WhereClause expression) {
    WhereClauseStateObject whereClause = stateObject.addWhereClause();
    whereClause.setExpression(expression);
    StateObject stateObject = buildStateObjectImp(expression.getConditionalExpression());
    whereClause.setConditional(stateObject);
  }
}

代码示例来源:origin: com.impetus.kundera.client/kundera-elastic-search

@Override
protected List<Object> populateEntities(EntityMetadata m, Client client)
{
  MetamodelImpl metaModel = (MetamodelImpl) kunderaMetadata.getApplicationMetadata().getMetamodel(
      m.getPersistenceUnit());
  EntityType entity = metaModel.entity(m.getEntityClazz());
  Expression whereExpression = KunderaQueryUtils.getWhereClause(kunderaQuery.getJpqlExpression());
  QueryBuilder filter = whereExpression == null || whereExpression instanceof NullExpression ? null
      : esFilterBuilder.populateFilterBuilder(((WhereClause) whereExpression).getConditionalExpression(), m);
  return ((ESClient) client).executeQuery(filter, buildAggregation(kunderaQuery, m, filter), m,
      getKunderaQuery(),this.firstResult, this.maxResult);
}

代码示例来源:origin: com.impetus.kundera.client/kundera-elastic-search

@Override
public Map<String, Object> search(KunderaMetadata kunderaMetadata, KunderaQuery kunderaQuery,
    PersistenceDelegator persistenceDelegator, EntityMetadata m, int firstResult, int maxResults)
{
  ESQuery query = new ESQuery<>(kunderaQuery, persistenceDelegator, kunderaMetadata);
  MetamodelImpl metaModel = (MetamodelImpl) kunderaMetadata.getApplicationMetadata()
      .getMetamodel(m.getPersistenceUnit());
  Expression whereExpression = KunderaQueryUtils.getWhereClause(kunderaQuery.getJpqlExpression());
  QueryBuilder filter = whereExpression != null ? query.getEsFilterBuilder()
      .populateFilterBuilder(((WhereClause) whereExpression).getConditionalExpression(), m) : null;
  FilteredQueryBuilder queryBuilder = QueryBuilders.filteredQuery(null, filter);
  SearchResponse response = getSearchResponse(kunderaQuery, queryBuilder, filter, query, m, firstResult,
      maxResults, kunderaMetadata);
  return buildResultMap(response, kunderaQuery, m, metaModel);
}

相关文章