src-db/database/model/tables/AD_TABLE.xml
author Augusto Mauch <augusto.mauch@openbravo.com>
Wed, 05 Jun 2013 14:03:22 +0200
changeset 20511 e426b7ccc826
parent 20510 f7a3e45cbddf
child 20512 02b4db5308b3
permissions -rw-r--r--
Fixes issue 23996: An event handler has been replaced with database constraints

The event handler TableDataOriginEventHandler has been replaced with database constraints. This is a better approach because it is simpler and easier to maint
ain.

The name of two of the messages has been updated so that it is the name as the constraint that throw them. The message used to warn the user that the table_name must be set if the data origin is 'Table' has been removed because now the table_name is mandatory again in the database.
<?xml version="1.0"?>
  <database name="TABLE AD_TABLE">
    <table name="AD_TABLE" primaryKey="AD_TABLE_KEY">
      <column name="AD_TABLE_ID" primaryKey="true" required="true" type="VARCHAR" size="32" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="AD_CLIENT_ID" primaryKey="false" required="true" type="VARCHAR" size="32" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="AD_ORG_ID" primaryKey="false" required="true" type="VARCHAR" size="32" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="ISACTIVE" primaryKey="false" required="true" type="CHAR" size="1" autoIncrement="false">
        <default><![CDATA[Y]]></default>
        <onCreateDefault/>
      </column>
      <column name="CREATED" primaryKey="false" required="true" type="TIMESTAMP" size="7" autoIncrement="false">
        <default><![CDATA[SYSDATE]]></default>
        <onCreateDefault/>
      </column>
      <column name="CREATEDBY" primaryKey="false" required="true" type="VARCHAR" size="32" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="UPDATED" primaryKey="false" required="true" type="TIMESTAMP" size="7" autoIncrement="false">
        <default><![CDATA[SYSDATE]]></default>
        <onCreateDefault/>
      </column>
      <column name="UPDATEDBY" primaryKey="false" required="true" type="VARCHAR" size="32" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="NAME" primaryKey="false" required="true" type="NVARCHAR" size="60" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="DESCRIPTION" primaryKey="false" required="false" type="NVARCHAR" size="255" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="HELP" primaryKey="false" required="false" type="NVARCHAR" size="2000" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="TABLENAME" primaryKey="false" required="true" type="VARCHAR" size="40" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="CLASSNAME" primaryKey="false" required="false" type="VARCHAR" size="60" autoIncrement="false">
        <default/>
        <onCreateDefault><![CDATA[REPLACE(NAME,'_','')]]></onCreateDefault>
      </column>
      <column name="ISVIEW" primaryKey="false" required="true" type="CHAR" size="1" autoIncrement="false">
        <default><![CDATA[N]]></default>
        <onCreateDefault/>
      </column>
      <column name="ACCESSLEVEL" primaryKey="false" required="true" type="VARCHAR" size="60" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="AD_WINDOW_ID" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="ISSECURITYENABLED" primaryKey="false" required="false" type="CHAR" size="1" autoIncrement="false">
        <default><![CDATA[N]]></default>
        <onCreateDefault/>
      </column>
      <column name="ISDELETEABLE" primaryKey="false" required="true" type="CHAR" size="1" autoIncrement="false">
        <default><![CDATA[Y]]></default>
        <onCreateDefault/>
      </column>
      <column name="ISHIGHVOLUME" primaryKey="false" required="true" type="CHAR" size="1" autoIncrement="false">
        <default><![CDATA[N]]></default>
        <onCreateDefault/>
      </column>
      <column name="IMPORTTABLE" primaryKey="false" required="false" type="CHAR" size="1" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="ISCHANGELOG" primaryKey="false" required="false" type="CHAR" size="1" autoIncrement="false">
        <default><![CDATA[N]]></default>
        <onCreateDefault/>
      </column>
      <column name="PO_WINDOW_ID" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="ISDEFAULTACCT" primaryKey="false" required="false" type="CHAR" size="1" autoIncrement="false">
        <default><![CDATA[N]]></default>
        <onCreateDefault/>
      </column>
      <column name="SQL_RECORD_IDENTIFIER" primaryKey="false" required="false" type="VARCHAR" size="4000" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="DEVELOPMENTSTATUS" primaryKey="false" required="false" type="VARCHAR" size="60" autoIncrement="false">
        <default><![CDATA[RE]]></default>
        <onCreateDefault/>
      </column>
      <column name="AD_PACKAGE_ID" primaryKey="false" required="true" type="VARCHAR" size="32" autoIncrement="false">
        <default><![CDATA[0]]></default>
        <onCreateDefault><![CDATA[SELECT AD_PACKAGE_ID FROM AD_PACKAGE WHERE AD_MODULE_ID<>'0']]></onCreateDefault>
      </column>
      <column name="TREETYPE" primaryKey="false" required="false" type="VARCHAR" size="60" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="ACCTDATE_COLUMN_ID" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="ACCTCLASSNAME" primaryKey="false" required="false" type="VARCHAR" size="1000" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="ISFULLYAUDITED" primaryKey="false" required="true" type="CHAR" size="1" autoIncrement="false">
        <default><![CDATA[N]]></default>
        <onCreateDefault><![CDATA['N']]></onCreateDefault>
      </column>
      <column name="ISAUDITINSERTS" primaryKey="false" required="true" type="CHAR" size="1" autoIncrement="false">
        <default><![CDATA[Y]]></default>
        <onCreateDefault><![CDATA['Y']]></onCreateDefault>
      </column>
      <column name="DATAORIGINTYPE" primaryKey="false" required="true" type="VARCHAR" size="60" autoIncrement="false">
        <default><![CDATA[Table]]></default>
        <onCreateDefault><![CDATA['Table']]></onCreateDefault>
      </column>
      <column name="OBSERDS_DATASOURCE_ID" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <foreign-key foreignTable="OBSERDS_DATASOURCE" name="AD_COLUMN_DATASOURCE">
        <reference local="OBSERDS_DATASOURCE_ID" foreign="OBSERDS_DATASOURCE_ID"/>
      </foreign-key>
      <foreign-key foreignTable="AD_COLUMN" name="AD_COLUMN_TABLE">
        <reference local="ACCTDATE_COLUMN_ID" foreign="AD_COLUMN_ID"/>
      </foreign-key>
      <foreign-key foreignTable="AD_PACKAGE" name="AD_PACKAGE_TABLE">
        <reference local="AD_PACKAGE_ID" foreign="AD_PACKAGE_ID"/>
      </foreign-key>
      <foreign-key foreignTable="AD_CLIENT" name="AD_TABLE_AD_CLIENT">
        <reference local="AD_CLIENT_ID" foreign="AD_CLIENT_ID"/>
      </foreign-key>
      <foreign-key foreignTable="AD_ORG" name="AD_TABLE_AD_ORG">
        <reference local="AD_ORG_ID" foreign="AD_ORG_ID"/>
      </foreign-key>
      <foreign-key foreignTable="AD_WINDOW" name="AD_TABLE_AD_WINDOW">
        <reference local="PO_WINDOW_ID" foreign="AD_WINDOW_ID"/>
      </foreign-key>
      <foreign-key foreignTable="AD_WINDOW" name="AD_WINDOW_TABLE" onDelete="setnull">
        <reference local="AD_WINDOW_ID" foreign="AD_WINDOW_ID"/>
      </foreign-key>
      <index name="AD_TABLE_PACKAGE_IDX" unique="false">
        <index-column name="AD_PACKAGE_ID"/>
      </index>
      <unique name="AD_TABLE_CLASSNAME_PACKAGE_UN">
        <unique-column name="CLASSNAME"/>
        <unique-column name="AD_PACKAGE_ID"/>
      </unique>
      <unique name="AD_TABLE_NAME">
        <unique-column name="NAME"/>
      </unique>
      <unique name="AD_TABLE_TREETYPE_UN">
        <unique-column name="TREETYPE"/>
      </unique>
      <check name="AD_TABLE_CLASSNAME_CHK"><![CDATA[((DATAORIGINTYPE) = 'DATASOURCE') OR (CLASSNAME IS NOT NULL)]]></check>
      <check name="AD_TABLE_DATASOURCE_CHK"><![CDATA[((DATAORIGINTYPE) = 'TABLE') OR (OBSERDS_DATASOURCE_ID IS NOT NULL)]]></check>
      <check name="AD_TABLE_ISACTIVE_CHK"><![CDATA[ISACTIVE IN ('Y', 'N')]]></check>
      <check name="AD_TABLE_ISAUDITINS_CHK"><![CDATA[ISAUDITINSERTS IN ('Y', 'N')]]></check>
      <check name="AD_TABLE_ISDELETEABLE_CHK"><![CDATA[ISDELETEABLE IN ('Y', 'N')]]></check>
      <check name="AD_TABLE_ISFULLYAUDITED_CHK"><![CDATA[ISFULLYAUDITED IN ('Y', 'N')]]></check>
      <check name="AD_TABLE_ISFULLYAUDITED_CHK2"><![CDATA[(ISFULLYAUDITED = 'N') OR (UPPER((TABLENAME)) <> 'AD_AUDIT_TRAIL')]]></check>
      <check name="AD_TABLE_ISHIGHVOLUME_CHK"><![CDATA[ISHIGHVOLUME IN ('Y', 'N')]]></check>
      <check name="AD_TABLE_ISSECUR_YENABLED_CHK"><![CDATA[ISSECURITYENABLED IN ('Y', 'N')]]></check>
      <check name="AD_TABLE_ISVIEW_CHK"><![CDATA[ISVIEW IN ('Y', 'N')]]></check>
    </table>
  </database>