test_class.file: dal-jdbc/src/test/java/org/unidal/dal/jdbc/query/token/resolver/TableTokenResolverTest.java
test_class.identifier: TableTokenResolverTest
test_class.superclass: extends AbstractTokenResolverTest
test_case.body: @Test
     public void testAnotherTableNonrelated() throws Exception {
        QueryDef query = new QueryDef("test", UserEntity.class, QueryType.SELECT, "<TABLE name='user2'/>");
        Readset<?> readset = UserEntity.READSET_FULL;
        User user = new User();
        QueryContext ctx = getSelectContext(query, user, readset);
  
        try {
           m_queryResolver.resolve(ctx);
  
           Assert.fail("DalRuntimeException expected");
        } catch (DalRuntimeException e) {
           // expected
        }
     }
test_case.class_method_signature: TableTokenResolverTest.testAnotherTableNonrelated()
test_case.full_signature: @Test public void testAnotherTableNonrelated()
test_case.identifier: testAnotherTableNonrelated
test_case.invocations: getSelectContext resolve fail
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testAnotherTableNonrelated()
focal_class.declarator: m_manager
focal_class.modifier: @Inject
     private
focal_class.original_string: @Inject
     private TableProviderManager m_manager;
focal_class.type: TableProviderManager
focal_class.var_name: m_manager
focal_class.declarator: m_naming
focal_class.modifier: @Inject
     private
focal_class.original_string: @Inject
     private QueryNaming m_naming;
focal_class.type: QueryNaming
focal_class.var_name: m_naming
focal_class.file: dal-jdbc/src/main/java/org/unidal/dal/jdbc/query/token/resolver/TableTokenResolver.java
focal_class.identifier: TableTokenResolver
focal_class.interfaces: implements TokenResolver
focal_class.class_method_signature: TableTokenResolver.resolve(Token token, QueryContext ctx)
focal_class.full_signature: public String resolve(Token token, QueryContext ctx)
focal_class.identifier: resolve
focal_class.modifiers: public
focal_class.parameters: (Token token, QueryContext ctx)
focal_class.return: String
focal_class.signature: String resolve(Token token, QueryContext ctx)
focal_method.body: public String resolve(Token token, QueryContext ctx) {
        if (token.getType() != TokenType.TABLE) {
           throw new DalRuntimeException("Internal error: only TABLE token is supported by " + getClass());
        }
  
        SimpleTagToken table = (SimpleTagToken) token;
        String tableName = table.getAttribute("name", ctx.getEntityInfo().getLogicalName());
        String[] logicalNameAndAlias = ctx.getEntityInfo().getLogicalNameAndAlias(tableName);
        TableProvider tableProvider = m_manager.getTableProvider(logicalNameAndAlias[0]);
        String physicalTableName = tableProvider.getPhysicalTableName(ctx.getQueryHints(), tableName);
  
        switch (ctx.getQuery().getType()) {
        case SELECT:
           String alias = table.getAttribute("alias", logicalNameAndAlias[1]);
  
           ctx.setTableResolved(true);
           return m_naming.getTable(physicalTableName, alias);
        case INSERT:
           return m_naming.getTable(physicalTableName);
        case UPDATE:
           return m_naming.getTable(physicalTableName);
        case DELETE:
           return m_naming.getTable(physicalTableName);
        default:
           throw new DalRuntimeException("TABLE token does not support query type: " + ctx.getQuery().getType());
        }
     }
focal_method.class_method_signature: TableTokenResolver.resolve(Token token, QueryContext ctx)
focal_method.full_signature: public String resolve(Token token, QueryContext ctx)
focal_method.identifier: resolve
focal_method.invocations: getType getClass getAttribute getLogicalName getEntityInfo getLogicalNameAndAlias getEntityInfo getTableProvider getPhysicalTableName getQueryHints getType getQuery getAttribute setTableResolved getTable getTable getTable getTable getType getQuery
focal_method.modifiers: public
focal_method.parameters: (Token token, QueryContext ctx)
focal_method.return: String
focal_method.signature: String resolve(Token token, QueryContext ctx)