org.eclipse.persistence.internal.expressions.QueryKeyExpression.getNestedAttributeName()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(4.0k)|赞(0)|评价(0)|浏览(67)

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

QueryKeyExpression.getNestedAttributeName介绍

[英]INTERNAL: Returns nested attribute name or null
[中]内部:返回嵌套属性名称或null

代码示例

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

/**
 * INTERNAL:
 * Returns nested attribute name or null
 */
public String getNestedAttributeName() {
  if(getMapping() != null) {
    String attributeName = getMapping().getAttributeName();
    if(this.baseExpression.isExpressionBuilder()) {
      return attributeName;
    } else if (this.baseExpression.isQueryKeyExpression()) {
      String nestedAttributeName = ((QueryKeyExpression)this.baseExpression).getNestedAttributeName();
      if(nestedAttributeName == null) {
        return null;
      } else {
        return nestedAttributeName + '.' + attributeName;
      }
    } else {
      return null;
    }
  } else {
    return null;
  }
}

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

/**
 * INTERNAL:
 * Returns nested attribute name or null
 */
public String getNestedAttributeName() {
  if(getMapping() != null) {
    String attributeName = getMapping().getAttributeName();
    if(this.baseExpression.isExpressionBuilder()) {
      return attributeName;
    } else if (this.baseExpression.isQueryKeyExpression()) {
      String nestedAttributeName = ((QueryKeyExpression)this.baseExpression).getNestedAttributeName();
      if(nestedAttributeName == null) {
        return null;
      } else {
        return nestedAttributeName + '.' + attributeName;
      }
    } else {
      return null;
    }
  } else {
    return null;
  }
}

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

/**
 * INTERNAL:
 * The method adds to the passed input vector the
 * fields or expressions corresponding to the joins.
 */
public void addJoinSelectionFields(Vector fields, boolean isCustomSQL) {
  // executiveFetchGroup is used for warnings only - always null if no warnings logged
  FetchGroup executionFetchGroup = null;
  if(session.shouldLog(SessionLog.WARNING, SessionLog.QUERY)) {
    executionFetchGroup = getExecutionFetchGroup();
  }
  for(Expression expression : getJoinedAttributeManager().getJoinedAttributeExpressions()) {
    addSelectionFieldsForJoinedExpression(fields, isCustomSQL, expression);
    // executiveFetchGroup is used for warnings only - always null if no warnings logged
    if(executionFetchGroup != null) {
      String nestedAttributeName = ((QueryKeyExpression)expression).getNestedAttributeName();
      if(nestedAttributeName != null) {
        if(!executionFetchGroup.containsAttributeInternal(nestedAttributeName)) {
          getSession().log(SessionLog.WARNING, SessionLog.QUERY, "query_has_joined_attribute_outside_fetch_group", new Object[]{toString(), nestedAttributeName});
        }
      }
    }
  }
  for(Expression expression : getJoinedAttributeManager().getJoinedMappingExpressions()) {
    addSelectionFieldsForJoinedExpression(fields, isCustomSQL, expression);
  }
}

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

/**
 * INTERNAL:
 * The method adds to the passed input vector the
 * fields or expressions corresponding to the joins.
 */
public void addJoinSelectionFields(Vector fields, boolean isCustomSQL) {
  // executiveFetchGroup is used for warnings only - always null if no warnings logged
  FetchGroup executionFetchGroup = null;
  if(session.shouldLog(SessionLog.WARNING, SessionLog.QUERY)) {
    executionFetchGroup = getExecutionFetchGroup();
  }
  for(Expression expression : getJoinedAttributeManager().getJoinedAttributeExpressions()) {
    addSelectionFieldsForJoinedExpression(fields, isCustomSQL, expression);
    // executiveFetchGroup is used for warnings only - always null if no warnings logged
    if(executionFetchGroup != null) {
      String nestedAttributeName = ((QueryKeyExpression)expression).getNestedAttributeName();
      if(nestedAttributeName != null) {
        if(!executionFetchGroup.containsAttribute(nestedAttributeName)) { // cuba
          getSession().log(SessionLog.WARNING, SessionLog.QUERY, "query_has_joined_attribute_outside_fetch_group", new Object[]{toString(), nestedAttributeName});
        }
      }
    }
  }
  for(Expression expression : getJoinedAttributeManager().getJoinedMappingExpressions()) {
    addSelectionFieldsForJoinedExpression(fields, isCustomSQL, expression);
  }
}

相关文章

微信公众号

最新文章

更多

QueryKeyExpression类方法