public BaseTable doMakeTable(Record record)
    {
        BaseTable table = null;
        boolean bIsQueryRecord = record.isQueryRecord();
        int iRawDBType = (record.getDatabaseType() & DBConstants.TABLE_TYPE_MASK);
        if ((((iRawDBType == DBConstants.LOCAL) || (iRawDBType == DBConstants.TABLE))
                && (!bIsQueryRecord))
            || ((iRawDBType == DBConstants.LOCAL)
                    || (iRawDBType == DBConstants.REMOTE)
                    || (iRawDBType == DBConstants.REMOTE_MEMORY)
                    || (iRawDBType == DBConstants.TABLE)))
        {
            table = new ClientTable(this, record);
            String strTableClassName = record.getClass().getName();
            try   {
                Task task = null;
                RemoteTask server = null;
                if (record.getRecordOwner() != null)
                    if (record.getRecordOwner().getTask() != null)
                        task = record.getRecordOwner().getTask();
                if (task != null)
                    server = (RemoteTask)task.getRemoteTask();
                if (server == null)
                    server = (RemoteTask)((Environment)this.getDatabaseOwner().getEnvironment()).getDefaultApplication().getRemoteTask(task, null, true);
//?                String strUserID = null;
//?                if (record.getRecordOwner() != null)
//?                    strUserID = record.getRecordOwner().getProperty(DBParams.USER_ID);
                RemoteTable tableRemote = null;
                synchronized (this.getSyncObject(server))
                {   // In case this is called from another task
                    Map<String,Object> properties = table.getProperties();
                    Map<String,Object> propDatabase = BaseDatabase.addDBProperties(this.getProperties(), this, null); 
                    tableRemote = server.makeRemoteTable(strTableClassName, null, properties, propDatabase);  // NOTE: I DO Send the table properties down.
                    ((ClientTable)table).setRemoteTable(tableRemote);
                }
                // Do not get the remote db connection unless I need it
            } catch (RemoteException ex)    {
                Utility.getLogger().warning("remote doMakeTable error: " + ex.getMessage());
                ex.printStackTrace();
            }
        }
        else
            table = super.doMakeTable(record);
        return table;
    }
public BaseTable doMakeTable ( Record record ) { BaseTable table = null ; boolean bIsQueryRecord = record . isQueryRecord ( ) ; int iRawDBType = ( record . getDatabaseType ( ) & DBConstants . TABLE_TYPE_MASK ) ; if ( ( ( ( iRawDBType == DBConstants . LOCAL ) || ( iRawDBType == DBConstants . TABLE ) ) && ( ! bIsQueryRecord ) ) || ( ( iRawDBType == DBConstants . LOCAL ) || ( iRawDBType == DBConstants . REMOTE ) || ( iRawDBType == DBConstants . REMOTE_MEMORY ) || ( iRawDBType == DBConstants . TABLE ) ) ) { table = new ClientTable ( this , record ) ; String strTableClassName = record . getClass ( ) . getName ( ) ; try { Task task = null ; RemoteTask server = null ; if ( record . getRecordOwner ( ) != null ) if ( record . getRecordOwner ( ) . getTask ( ) != null ) task = record . getRecordOwner ( ) . getTask ( ) ; if ( task != null ) server = ( RemoteTask ) task . getRemoteTask ( ) ; if ( server == null ) server = ( RemoteTask ) ( ( Environment ) this . getDatabaseOwner ( ) . getEnvironment ( ) ) . getDefaultApplication ( ) . getRemoteTask ( task , null , true ) ; RemoteTable tableRemote = null ; synchronized ( this . getSyncObject ( server ) ) { Map < String , Object > properties = table . getProperties ( ) ; Map < String , Object > propDatabase = BaseDatabase . addDBProperties ( this . getProperties ( ) , this , null ) ; tableRemote = server . makeRemoteTable ( strTableClassName , null , properties , propDatabase ) ; ( ( ClientTable ) table ) . setRemoteTable ( tableRemote ) ; } } catch ( RemoteException ex ) { Utility . getLogger ( ) . warning ( "remote doMakeTable error: " + ex . getMessage ( ) ) ; ex . printStackTrace ( ) ; } } else table = super . doMakeTable ( record ) ; return table ; }
Make a table for this record.
@param record The record to make a table for (look at the database type).
@return The new table for this record.