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

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

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

QueryKeyExpression.getQueryKeyOrNull介绍

暂无

代码示例

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

/**
 * INTERNAL:
 */
@Override
public DatabaseField getField() {
  if (!isAttribute()) {
    return null;
  }
  QueryKey key = getQueryKeyOrNull();
  if ((key != null) && key.isDirectQueryKey()) {
    return ((DirectQueryKey)key).getField();
  }
  DatabaseMapping mapping = getMapping();
  if ((mapping == null) || mapping.getFields().isEmpty()) {
    return null;
  }
  return mapping.getFields().get(0);
}

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

/**
 * INTERNAL:
 */
@Override
public DatabaseField getField() {
  if (!isAttribute()) {
    return null;
  }
  QueryKey key = getQueryKeyOrNull();
  if ((key != null) && key.isDirectQueryKey()) {
    return ((DirectQueryKey)key).getField();
  }
  DatabaseMapping mapping = getMapping();
  if ((mapping == null) || mapping.getFields().isEmpty()) {
    return null;
  }
  return mapping.getFields().get(0);
}

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

/**
 * INTERNAL:
 * Indicates whether this expression corresponds to OneToMany.
 */
public boolean isOneToMany() {
  if(getMapping() != null) {
    return getMapping().isOneToManyMapping();
  } else {
    if(getQueryKeyOrNull() != null) {
      return this.queryKey.isOneToManyQueryKey();
    } else {
      return false;
    }
  }
}

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

/**
 * INTERNAL:
 * Indicates whether this expression corresponds to OneToOne.
 */
public boolean isOneToOne() {
  if(getMapping() != null) {
    return getMapping().isOneToOneMapping();
  } else {
    if(getQueryKeyOrNull() != null) {
      return this.queryKey.isOneToOneQueryKey();
    } else {
      return false;
    }
  }
}

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

/**
 * INTERNAL:
 * Indicates whether this expression corresponds to ManyToMany.
 */
public boolean isManyToMany() {
  if(getMapping() != null) {
    return getMapping().isManyToManyMapping();
  } else {
    if(getQueryKeyOrNull() != null) {
      return this.queryKey.isManyToManyQueryKey();
    } else {
      return false;
    }
  }
}

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

/**
 * INTERNAL:
 * Indicates whether this expression corresponds to DirectCollection.
 */
public boolean isDirectCollection() {
  if(getMapping() != null) {
    return getMapping().isDirectCollectionMapping();
  } else {
    if(getQueryKeyOrNull() != null) {
      return this.queryKey.isDirectCollectionQueryKey();
    } else {
      return false;
    }
  }
}

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

/**
 * INTERNAL:
 * Indicates whether this expression corresponds to OneToOne.
 */
public boolean isOneToOne() {
  if(getMapping() != null) {
    return getMapping().isOneToOneMapping();
  } else {
    if(getQueryKeyOrNull() != null) {
      return this.queryKey.isOneToOneQueryKey();
    } else {
      return false;
    }
  }
}

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

/**
 * INTERNAL:
 * Indicates whether this expression corresponds to OneToMany.
 */
public boolean isOneToMany() {
  if(getMapping() != null) {
    return getMapping().isOneToManyMapping();
  } else {
    if(getQueryKeyOrNull() != null) {
      return this.queryKey.isOneToManyQueryKey();
    } else {
      return false;
    }
  }
}

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

/**
 * INTERNAL:
 * Indicates whether this expression corresponds to DirectCollection.
 */
@Override
public boolean isDirectCollection() {
  if(getMapping() != null) {
    return getMapping().isDirectCollectionMapping();
  } else {
    if(getQueryKeyOrNull() != null) {
      return this.queryKey.isDirectCollectionQueryKey();
    } else {
      return false;
    }
  }
}

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

/**
 * INTERNAL:
 * Indicates whether this expression corresponds to OneToOne.
 */
public boolean isOneToOne() {
  if(getMapping() != null) {
    return getMapping().isOneToOneMapping();
  } else {
    if(getQueryKeyOrNull() != null) {
      return this.queryKey.isOneToOneQueryKey();
    } else {
      return false;
    }
  }
}

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

/**
 * INTERNAL:
 * Indicates whether this expression corresponds to OneToMany.
 */
public boolean isOneToMany() {
  if(getMapping() != null) {
    return getMapping().isOneToManyMapping();
  } else {
    if(getQueryKeyOrNull() != null) {
      return this.queryKey.isOneToManyQueryKey();
    } else {
      return false;
    }
  }
}

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

/**
 * INTERNAL:
 * Indicates whether this expression corresponds to ManyToMany.
 */
public boolean isManyToMany() {
  if(getMapping() != null) {
    return getMapping().isManyToManyMapping();
  } else {
    if(getQueryKeyOrNull() != null) {
      return this.queryKey.isManyToManyQueryKey();
    } else {
      return false;
    }
  }
}

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

/**
 * INTERNAL:
 * Indicates whether this expression corresponds to ManyToMany.
 */
public boolean isManyToMany() {
  if(getMapping() != null) {
    return getMapping().isManyToManyMapping();
  } else {
    if(getQueryKeyOrNull() != null) {
      return this.queryKey.isManyToManyQueryKey();
    } else {
      return false;
    }
  }
}

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

/**
 * INTERNAL:
 * Indicates whether this expression corresponds to DirectCollection.
 */
@Override
public boolean isDirectCollection() {
  if(getMapping() != null) {
    return getMapping().isDirectCollectionMapping();
  } else {
    if(getQueryKeyOrNull() != null) {
      return this.queryKey.isDirectCollectionQueryKey();
    } else {
      return false;
    }
  }
}

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

public DatabaseMapping getMappingFromQueryKey() {
  QueryKey queryKey = getQueryKeyOrNull();
  if ((queryKey == null) || (!(queryKey instanceof DirectQueryKey))) {
    throw QueryException.cannotConformExpression();
  }
  mapping = queryKey.getDescriptor().getObjectBuilder().getMappingForField(((DirectQueryKey)queryKey).getField());
  if (mapping == null) {
    throw QueryException.cannotConformExpression();
  }
  return mapping;
}

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

public DatabaseMapping getMappingFromQueryKey() {
  QueryKey queryKey = getQueryKeyOrNull();
  if ((queryKey == null) || (!(queryKey instanceof DirectQueryKey))) {
    throw QueryException.cannotConformExpression();
  }
  mapping = queryKey.getDescriptor().getObjectBuilder().getMappingForField(((DirectQueryKey)queryKey).getField());
  if (mapping == null) {
    throw QueryException.cannotConformExpression();
  }
  return mapping;
}

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

public DatabaseMapping getMappingFromQueryKey() {
  QueryKey queryKey = getQueryKeyOrNull();
  if ((queryKey == null) || (!(queryKey instanceof DirectQueryKey))) {
    throw QueryException.cannotConformExpression();
  }
  mapping = queryKey.getDescriptor().getObjectBuilder().getMappingForField(((DirectQueryKey)queryKey).getField());
  if (mapping == null) {
    throw QueryException.cannotConformExpression();
  }
  return mapping;
}

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

/**
 * Calculate the reference table for based on the various QueryKeyExpression
 * usages (join query keys, custom defined query keys, or query keys for
 * mappings).
 *
 * Called from {@link SQLSelectStatement#appendFromClauseForOuterJoin}.
 *
 * @return DatabaseTable
 */
public DatabaseTable getReferenceTable() {
  if(getMapping() != null) {
    if (getMapping().isDirectCollectionMapping()) {
      return ((DirectCollectionMapping)getMapping()).getReferenceTable();
    } else {
      return getMapping().getReferenceDescriptor().getTables().firstElement();
    }
  } else {
    return ((ForeignReferenceQueryKey)getQueryKeyOrNull()).getReferenceTable(getDescriptor());
  }
}

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

/**
 * Calculate the reference table for based on the various QueryKeyExpression
 * usages (join query keys, custom defined query keys, or query keys for
 * mappings).
 * 
 * Called from {@link SQLSelectStatement#appendFromClauseForOuterJoin}.
 * 
 * @return DatabaseTable
 */    
public DatabaseTable getReferenceTable() {
  if(getMapping() != null) {
    if (getMapping().isDirectCollectionMapping()) {
      return ((DirectCollectionMapping)getMapping()).getReferenceTable();
    } else {
      return getMapping().getReferenceDescriptor().getTables().firstElement();
    }
  } else {
    return ((ForeignReferenceQueryKey)getQueryKeyOrNull()).getReferenceTable(getDescriptor());
  }
}

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

/**
 * INTERNAL:
 * If a descriptor cannot be found, then return null.
 */
@Override
public QueryKey getQueryKeyOrNull() {
  if (!hasQueryKey) {
    return null;
  }
  if (getContainingDescriptor() == null) {
    // Assign an artificial query key to represent the alias.
    DirectQueryKey alias = new DirectQueryKey();
    alias.setField(new DatabaseField(this.name));
    ReportQuery subQuery = ((FromSubSelectExpression)getBaseExpression()).getSubSelect().getSubQuery();
    alias.setDescriptor(subQuery.getDescriptor());
    this.queryKey = alias;
    return alias;
  }
  return super.getQueryKeyOrNull();
}

相关文章

微信公众号

最新文章

更多

QueryKeyExpression类方法