case GET_TABLE:
if( db != null )
{
final String tableName = Conversor.toString( args[0] );
final Table table = db.getTable(
tableName
);
if( table != null )
{
Hashtable tables = (Hashtable)
target.getAttachment( "tables" );
if( tables == null )
{
tables = new Hashtable( 10 );
target.setAttachment( "tables", tables );
}
Instance t = (Instance) tables.get( tableName );
if( t == null )
{
t = getVirtualMachine().newInstance( "Table" );
t.setAttachment( "table", table );
t.setAttachment( "parent", target );
tables.put( tableName, t );
}
return t;
}
else
{
return null;
}
}
else
{
return null;
}
case CREATE_TABLE:
if( db != null )
{
final Table table = (Table)
args[0].getAttachment( "table" );
db.createTable( table );
Hashtable tables = (Hashtable)
target.getAttachment( "tables" );
if( tables == null )
{
tables = new Hashtable( 10 );
target.setAttachment( "tables", tables );
}
Instance t = (Instance) tables.get( table.getName() );
if( t == null )
{
t = getVirtualMachine().newInstance( "Table" );
t.setAttachment( "table", table );
t.setAttachment( "parent", target );
tables.put( table.getName(), t );
}
return t;
}
else
{