org.eclipse.persistence.exceptions.QueryException.invalidQueryKeyInExpression()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(10.6k)|赞(0)|评价(0)|浏览(113)

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

QueryException.invalidQueryKeyInExpression介绍

暂无

代码示例

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

/**
   * INTERNAL:
   * Return the report item that this is an alias for.
   */
  public ReportItem getItem() {
    if (this.item == null) {
      ReportQuery subQuery = ((FromSubSelectExpression)getBaseExpression()).getSubSelect().getSubQuery();
      this.item = subQuery.getItem(this.name);
      if (this.item == null) {
        throw QueryException.invalidQueryKeyInExpression(this.name);
      }
    }
    return this.item;
  }
}

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

/**
   * INTERNAL:
   * Return the report item that this is an alias for.
   */
  public ReportItem getItem() {
    if (this.item == null) {
      ReportQuery subQuery = ((FromSubSelectExpression)getBaseExpression()).getSubSelect().getSubQuery();
      this.item = subQuery.getItem(this.name);
      if (this.item == null) {
        throw QueryException.invalidQueryKeyInExpression(this.name);
      }
    }
    return this.item;
  }
}

代码示例来源: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: com.haulmont.thirdparty/eclipselink

foreignKeys = acm.getTargetForeignKeyToSourceKeys();
} else {
  throw QueryException.invalidQueryKeyInExpression(connectBy);

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

foreignKeys = acm.getTargetForeignKeyToSourceKeys();
} else {
  throw QueryException.invalidQueryKeyInExpression(connectBy);

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

/**
 * Do any required validation for this node. Throw an exception if it's incorrect.
 */
@Override
public void validateNode() {
  if ((getQueryKeyOrNull() == null) && (getMapping() == null)) {
    throw QueryException.invalidQueryKeyInExpression(getName());
  }
  if (!getMapping().isCollectionMapping()) {
    throw QueryException.mapEntryExpressionForNonCollection(getBaseExpression(), getMapping());
  }
  ContainerPolicy cp = getMapping().getContainerPolicy();
  if ((cp == null) || !cp.isMapPolicy()) {
    throw QueryException.mapEntryExpressionForNonMap(getBaseExpression(), getMapping());
  }
}

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

/**
 * Do any required validation for this node. Throw an exception if it's incorrect.
 */
@Override
public void validateNode() {
  if ((getQueryKeyOrNull() == null) && (getMapping() == null)) {
    throw QueryException.invalidQueryKeyInExpression(getName());
  }
  if (!getMapping().isCollectionMapping()) {
    throw QueryException.mapEntryExpressionForNonCollection(getBaseExpression(), getMapping());
  }
  ContainerPolicy cp = getMapping().getContainerPolicy();
  if ((cp == null) || !cp.isMapPolicy()) {
    throw QueryException.mapEntryExpressionForNonMap(getBaseExpression(), getMapping());
  }
}

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

public ClassDescriptor getDescriptor() {
  if (isAttribute()) {
    return null;
  }
  if (descriptor == null) {
    // Look first for query keys, then mappings. Ultimately we should have query keys
    // for everything and can dispense with the mapping part.
    ForeignReferenceQueryKey queryKey = (ForeignReferenceQueryKey)getQueryKeyOrNull();
    if (queryKey != null) {
      descriptor = getSession().getDescriptor(queryKey.getReferenceClass());
      return descriptor;
    }
    if (getMapping() == null) {
      throw QueryException.invalidQueryKeyInExpression(this);
    }
    // We assume this is either a foreign reference or an aggregate mapping
    descriptor = getMapping().getReferenceDescriptor();
    if (getMapping().isVariableOneToOneMapping()) {
      throw QueryException.cannotQueryAcrossAVariableOneToOneMapping(getMapping(), descriptor);
    }
  }
  return descriptor;
}

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

/**
 * Do any required validation for this node. Throw an exception if it's incorrect.
 */
public void validateNode() {
  if ((getQueryKeyOrNull() == null) && (getMapping() == null)) {
    throw QueryException.invalidQueryKeyInExpression(getName());
  }
  if (!getMapping().isCollectionMapping()){
    throw QueryException.mapEntryExpressionForNonCollection(getBaseExpression(), getMapping());
  }
  ContainerPolicy cp = getMapping().getContainerPolicy();
  if ((cp == null) || !(cp.isMapPolicy() || cp.isDirectMapPolicy())){
    throw QueryException.mapEntryExpressionForNonMap(getBaseExpression(), getMapping());
  }
}

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

@Override
public ClassDescriptor getDescriptor() {
  if (isAttribute()) {
    return null;
  }
  if (descriptor == null) {
    // Look first for query keys, then mappings. Ultimately we should have query keys
    // for everything and can dispense with the mapping part.
    ForeignReferenceQueryKey queryKey = (ForeignReferenceQueryKey)getQueryKeyOrNull();
    if (queryKey != null) {
      descriptor = getSession().getDescriptor(queryKey.getReferenceClass());
      return descriptor;
    }
    if (getMapping() == null) {
      throw QueryException.invalidQueryKeyInExpression(this);
    }
    // We assume this is either a foreign reference or an aggregate mapping
    descriptor = getMapping().getContainerPolicy().getDescriptorForMapKey();
    if (getMapping().isVariableOneToOneMapping()) {
      throw QueryException.cannotQueryAcrossAVariableOneToOneMapping(getMapping(), descriptor);
    }
  }
  return descriptor;
}

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

public ClassDescriptor getDescriptor() {
  if (isAttribute()) {
    return null;
  }
  if (descriptor == null) {
    // Look first for query keys, then mappings. Ultimately we should have query keys
    // for everything and can dispense with the mapping part.
    ForeignReferenceQueryKey queryKey = (ForeignReferenceQueryKey)getQueryKeyOrNull();
    if (queryKey != null) {
      descriptor = getSession().getDescriptor(queryKey.getReferenceClass());
      return descriptor;
    }
    if (getMapping() == null) {
      throw QueryException.invalidQueryKeyInExpression(this);
    }
    // We assume this is either a foreign reference or an aggregate mapping
    descriptor = getMapping().getContainerPolicy().getDescriptorForMapKey();
    if (getMapping().isVariableOneToOneMapping()) {
      throw QueryException.cannotQueryAcrossAVariableOneToOneMapping(getMapping(), descriptor);
    }
  }
  return descriptor;
}

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

@Override
public ClassDescriptor getDescriptor() {
  if (isAttribute()) {
    return null;
  }
  if (descriptor == null) {
    // Look first for query keys, then mappings. Ultimately we should have query keys
    // for everything and can dispense with the mapping part.
    ForeignReferenceQueryKey queryKey = (ForeignReferenceQueryKey)getQueryKeyOrNull();
    if (queryKey != null) {
      descriptor = getSession().getDescriptor(queryKey.getReferenceClass());
      return descriptor;
    }
    if (getMapping() == null) {
      throw QueryException.invalidQueryKeyInExpression(this);
    }
    // We assume this is either a foreign reference or an aggregate mapping
    descriptor = getMapping().getContainerPolicy().getDescriptorForMapKey();
    if (getMapping().isVariableOneToOneMapping()) {
      throw QueryException.cannotQueryAcrossAVariableOneToOneMapping(getMapping(), descriptor);
    }
  }
  return descriptor;
}

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

@Override
public ClassDescriptor getDescriptor() {
  if (isAttribute()) {
    return null;
  }
  if (descriptor == null) {
    // Look first for query keys, then mappings. Ultimately we should have query keys
    // for everything and can dispense with the mapping part.
    ForeignReferenceQueryKey queryKey = (ForeignReferenceQueryKey)getQueryKeyOrNull();
    if (queryKey != null) {
      descriptor = convertToCastDescriptor(getSession().getDescriptor(queryKey.getReferenceClass()), getSession());
      return descriptor;
    }
    if (getMapping() == null) {
      throw QueryException.invalidQueryKeyInExpression(this);
    }
    // We assume this is either a foreign reference or an aggregate mapping
    descriptor = getMapping().getReferenceDescriptor();
    if (getMapping().isVariableOneToOneMapping()) {
      throw QueryException.cannotQueryAcrossAVariableOneToOneMapping(getMapping(), descriptor);
    }
    descriptor = convertToCastDescriptor(descriptor, getSession());
  }
  return descriptor;
}

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

@Override
public ClassDescriptor getDescriptor() {
  if (isAttribute()) {
    return null;
  }
  if (descriptor == null) {
    // Look first for query keys, then mappings. Ultimately we should have query keys
    // for everything and can dispense with the mapping part.
    ForeignReferenceQueryKey queryKey = (ForeignReferenceQueryKey)getQueryKeyOrNull();
    if (queryKey != null) {
      descriptor = convertToCastDescriptor(getSession().getDescriptor(queryKey.getReferenceClass()), getSession());
      return descriptor;
    }
    if (getMapping() == null) {
      throw QueryException.invalidQueryKeyInExpression(this);
    }
    // We assume this is either a foreign reference or an aggregate mapping
    descriptor = getMapping().getReferenceDescriptor();
    if (getMapping().isVariableOneToOneMapping()) {
      throw QueryException.cannotQueryAcrossAVariableOneToOneMapping(getMapping(), descriptor);
    }
    descriptor = convertToCastDescriptor(descriptor, getSession());
  }
  return descriptor;
}

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

throw QueryException.invalidQueryKeyInExpression(attributeName);

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

throw QueryException.invalidQueryKeyInExpression(getName());

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

throw QueryException.invalidQueryKeyInExpression(getName());

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

throw QueryException.invalidQueryKeyInExpression(getName());

相关文章

微信公众号

最新文章

更多

QueryException类方法