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

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

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

QueryKeyExpression.getContainingDescriptor介绍

[英]INTERNAL: Return the descriptor which contains this query key.
[中]内部:返回包含此查询键的描述符。

代码示例

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

@Override
public QueryKey getQueryKeyOrNull() {
  if (!hasQueryKey) {
    return null;
  }
  // Oct 19, 2000 JED
  // Added try/catch. This was throwing a NPE in the following case
  // expresssionBuilder.get("firstName").get("bob")
  //moved by Gordon Yorke to cover validate and normalize
  if (getContainingDescriptor() == null) {
    throw QueryException.invalidQueryKeyInExpression(getName());
  }
  if (queryKey == null) {
    queryKey = getContainingDescriptor().getQueryKeyNamed(getName());
    if (queryKey == null) {
      hasQueryKey = false;
    }
  }
  return queryKey;
}

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

public QueryKey getQueryKeyOrNull() {
  if (!hasQueryKey) {
    return null;
  }
  // Oct 19, 2000 JED
  // Added try/catch. This was throwing a NPE in the following case
  // expresssionBuilder.get("firstName").get("bob")
  //moved by Gordon Yorke to cover validate and normalize
  if (getContainingDescriptor() == null) {
    throw QueryException.invalidQueryKeyInExpression(getName());
  }
  if (queryKey == null) {
    queryKey = getContainingDescriptor().getQueryKeyNamed(getName());
    if (queryKey == null) {
      hasQueryKey = false;
    }
  }
  return queryKey;
}

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

@Override
public QueryKey getQueryKeyOrNull() {
  if (!hasQueryKey) {
    return null;
  }
  // Oct 19, 2000 JED
  // Added try/catch. This was throwing a NPE in the following case
  // expresssionBuilder.get("firstName").get("bob")
  //moved by Gordon Yorke to cover validate and normalize
  if (getContainingDescriptor() == null) {
    throw QueryException.invalidQueryKeyInExpression(getName());
  }
  if (queryKey == null) {
    queryKey = getContainingDescriptor().getQueryKeyNamed(getName());
    if (queryKey == null) {
      hasQueryKey = false;
    }
  }
  return queryKey;
}

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

/**
 * INTERNAL:
 */
public DatabaseField getField() {
  if (!isAttribute()) {
    return null;
  }
  return getContainingDescriptor().getObjectBuilder().getFieldForQueryKeyName(getName());
}

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

/**
 * INTERNAL:
 * If the alias is for a query key item, then return its descriptor.
 * If it is for a function, then it has no descriptor.
 */
@Override
public ClassDescriptor getContainingDescriptor() {
  AbstractSession session = getBuilder().getSession();
  if (this.containingDescriptor == null) {
    Expression expression = getItem().getAttributeExpression();
    if (expression.isQueryKeyExpression()) {
      // Need to ensure expression has a session before getting its descriptor.
      if (expression.getBuilder().getSession() == null) {
        expression.getBuilder().setSession(session);
      }
      this.containingDescriptor = ((QueryKeyExpression)expression).getContainingDescriptor();
      return this.containingDescriptor;
    }
    return null;
  }
  return containingDescriptor;
}

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

/**
 * INTERNAL:
 * If the alias is for a query key item, then return its descriptor.
 * If it is for a function, then it has no descriptor.
 */
@Override
public ClassDescriptor getContainingDescriptor() {
  AbstractSession session = getBuilder().getSession();
  if (this.containingDescriptor == null) {
    Expression expression = getItem().getAttributeExpression();
    if (expression.isQueryKeyExpression()) {
      // Need to ensure expression has a session before getting its descriptor.
      if (expression.getBuilder().getSession() == null) {
        expression.getBuilder().setSession(session);
      }
      this.containingDescriptor = ((QueryKeyExpression)expression).getContainingDescriptor();
      return this.containingDescriptor;
    }
    return null;
  }
  return containingDescriptor;
}

相关文章

微信公众号

最新文章

更多

QueryKeyExpression类方法