public TableInstance resolveByAlias(String alias) { resolvedClass = null; TypeInfo typeInfo = (TypeInfo) aliasToTypeInfo.get(alias); if (typeInfo != null) { resolvedClass = typeInfo.getClazz(); return typeInfo.getTableInstance(); } TableInstance tblInstance = null; if (superContext != null) { tblInstance = superContext.resolveByAlias(alias); resolvedClass = superContext.getResolvedClass(); } return tblInstance; }
public TableInstance resolveByBEName(String beName) throws QueryParsingException { TypeInfo typeInfo = findTypeInfo(beName); if (typeInfo != null) { if (typeInfo.isUnconflict()) { resolvedClass = typeInfo.getClazz(); return typeInfo.getTableInstance(); } throw new QueryParsingException("{0}is an ambiguous type reference", new Object[] {beName}); } if (superContext != null) { TableInstance tableInstance = superContext.resolveByBEName(beName); resolvedClass = superContext.getResolvedClass(); return tableInstance; } throw new QueryParsingException("type {0} not found", new Object[] {beName}); }
public TableInstance resolveByFieldName(String fieldName) throws QueryParsingException { resolvedClass = null; String resolvedAlias = null; for (Iterator it = aliasToTypeInfo.entrySet().iterator(); it.hasNext(); ) { Map.Entry entry = (Map.Entry) it.next(); String alias = (String) entry.getKey(); TypeInfo typeInfo = (TypeInfo) entry.getValue(); if (typeInfo.getColFieldName() != null) { continue; } } if (superContext != null) { TableInstance tblInstance = superContext.resolveByFieldName(fieldName); resolvedClass = superContext.getResolvedClass(); return tblInstance; } throw new QueryParsingException("field {0} not found", new Object[] {fieldName}); }