本文整理了Java中org.eclipse.persistence.internal.expressions.QueryKeyExpression.aliasForTable
方法的一些代码示例,展示了QueryKeyExpression.aliasForTable
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。QueryKeyExpression.aliasForTable
方法的具体详情如下:
包路径:org.eclipse.persistence.internal.expressions.QueryKeyExpression
类名称:QueryKeyExpression
方法名:aliasForTable
[英]INTERNAL: Find the alias for a given table
[中]内部:查找给定表的别名
代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence
private String getQualifiedName(DatasourcePlatform platform, boolean allowDelimiters){
if (qualifiedName == null) {
// Print nested table using the TABLE function.
DatabaseMapping mapping = queryKeyExpression.getMapping();
DatabaseTable nestedTable = mapping.getDescriptor().getTables().firstElement();
DatabaseTable tableAlias = queryKeyExpression.getBaseExpression().aliasForTable(nestedTable);
DatabaseTable nestedTableAlias = queryKeyExpression.aliasForTable(this);
StringBuffer name = new StringBuffer();
name.append("TABLE(");
if (allowDelimiters && useDelimiters){
name.append(platform.getStartDelimiter());
}
name.append(tableAlias.getName());
if (allowDelimiters && useDelimiters){
name.append(platform.getEndDelimiter());
}
name.append(".");
if (allowDelimiters && useDelimiters){
name.append(platform.getStartDelimiter());
}
name.append(mapping.getField().getNameDelimited(platform));
if (allowDelimiters && useDelimiters){
name.append(platform.getEndDelimiter());
}
name.append(")");
qualifiedName = name.toString();
}
return qualifiedName;
}
代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core
this.targetAlias = expression.aliasForTable(this.targetTable);
代码示例来源:origin: com.haulmont.thirdparty/eclipselink
this.targetAlias = expression.aliasForTable(this.targetTable);
代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence
DatabaseTable targetAlias = outerExpression.aliasForTable(targetTable);
target.hasMoreElements();) {
DatabaseTable newTarget = (DatabaseTable)target.nextElement();
DatabaseTable newAlias = outerExpression.aliasForTable(newTarget);
writer.write(", OUTER ");
writer.write(newTarget.getQualifiedNameDelimited(printer.getPlatform()));
代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core
DatabaseTable targetAlias = outerExpression.aliasForTable(targetTable);
target.hasMoreElements();) {
DatabaseTable newTarget = (DatabaseTable)target.nextElement();
DatabaseTable newAlias = outerExpression.aliasForTable(newTarget);
writer.write(", OUTER ");
writer.write(newTarget.getQualifiedNameDelimited(printer.getPlatform()));
代码示例来源:origin: com.haulmont.thirdparty/eclipselink
DatabaseTable targetAlias = outerExpression.aliasForTable(targetTable);
target.hasMoreElements();) {
DatabaseTable newTarget = (DatabaseTable)target.nextElement();
DatabaseTable newAlias = outerExpression.aliasForTable(newTarget);
writer.write(", OUTER ");
writer.write(newTarget.getQualifiedNameDelimited(printer.getPlatform()));
代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence
sourceTable = outerExpression.getSourceTable();
sourceAlias = outerExpression.getBaseExpression().aliasForTable(sourceTable);
targetAlias = outerExpression.aliasForTable(targetTable);
} else {
sourceTable = ((ClassDescriptor)getDescriptorsForMultitableInheritanceOnly().get(index)).getTables().firstElement();
代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core
/**
* INTERNAL:
* Print SQL onto the stream, using the ExpressionPrinter for context
*/
@Override
public void printSQL(ExpressionSQLPrinter printer) {
if (isAttribute()) {
printer.printField(getAliasedField());
}
// If the mapping is a direct collection then this falls into a gray area.
// It must be treated as an attribute at this moment for it has a direct field.
// However it is not an attribute in the sense that it also represents a foreign
// reference and a mapping criteria has been added.
// For bug 2900974 these are now handled as non-attributes during normalize but
// as attributes when printing SQL.
//
if ((!isAttribute()) && (getMapping() != null) && getMapping().isDirectCollectionMapping()) {
DirectCollectionMapping directCollectionMapping = (DirectCollectionMapping)getMapping();
// The aliased table comes for free as it was a required part of the join criteria.
TableExpression table = (TableExpression)getTable(directCollectionMapping.getReferenceTable());
DatabaseTable aliasedTable = table.aliasForTable(table.getTable());
DatabaseField aliasedField = directCollectionMapping.getDirectField().clone();
aliasedField.setTable(aliasedTable);
printer.printField(aliasedField);
}
if ((getMapping() != null) && getMapping().isNestedTableMapping()) {
DatabaseTable tableAlias = aliasForTable(new NestedTable(this));
printer.printString(tableAlias.getName());
}
}
代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence
/**
* INTERNAL:
* Print SQL onto the stream, using the ExpressionPrinter for context
*/
public void printSQL(ExpressionSQLPrinter printer) {
if (isAttribute()) {
printer.printField(getAliasedField());
}
// If the mapping is a direct collection then this falls into a gray area.
// It must be treated as an attribute at this moment for it has a direct field.
// However it is not an attribute in the sense that it also represents a foreign
// reference and a mapping criteria has been added.
// For bug 2900974 these are now handled as non-attributes during normalize but
// as attributes when printing SQL.
//
if ((!isAttribute()) && (getMapping() != null) && getMapping().isDirectCollectionMapping()) {
DirectCollectionMapping directCollectionMapping = (DirectCollectionMapping)getMapping();
// The aliased table comes for free as it was a required part of the join criteria.
TableExpression table = (TableExpression)getTable(directCollectionMapping.getReferenceTable());
DatabaseTable aliasedTable = table.aliasForTable(table.getTable());
DatabaseField aliasedField = (DatabaseField)directCollectionMapping.getDirectField().clone();
aliasedField.setTable(aliasedTable);
printer.printField(aliasedField);
}
if ((getMapping() != null) && getMapping().isNestedTableMapping()) {
DatabaseTable tableAlias = aliasForTable(new NestedTable(this));
printer.printString(tableAlias.getName());
}
}
代码示例来源:origin: com.haulmont.thirdparty/eclipselink
/**
* INTERNAL:
* Print SQL onto the stream, using the ExpressionPrinter for context
*/
@Override
public void printSQL(ExpressionSQLPrinter printer) {
if (isAttribute()) {
printer.printField(getAliasedField());
}
// If the mapping is a direct collection then this falls into a gray area.
// It must be treated as an attribute at this moment for it has a direct field.
// However it is not an attribute in the sense that it also represents a foreign
// reference and a mapping criteria has been added.
// For bug 2900974 these are now handled as non-attributes during normalize but
// as attributes when printing SQL.
//
if ((!isAttribute()) && (getMapping() != null) && getMapping().isDirectCollectionMapping()) {
DirectCollectionMapping directCollectionMapping = (DirectCollectionMapping)getMapping();
// The aliased table comes for free as it was a required part of the join criteria.
TableExpression table = (TableExpression)getTable(directCollectionMapping.getReferenceTable());
DatabaseTable aliasedTable = table.aliasForTable(table.getTable());
DatabaseField aliasedField = directCollectionMapping.getDirectField().clone();
aliasedField.setTable(aliasedTable);
printer.printField(aliasedField);
}
if ((getMapping() != null) && getMapping().isNestedTableMapping()) {
DatabaseTable tableAlias = aliasForTable(new NestedTable(this));
printer.printString(tableAlias.getName());
}
}
内容来源于网络,如有侵权,请联系作者删除!