Commit 07d83d34 by Chamath

Remove mandatory constraints of MessageID and ApplicationStatus in MessageTemplate.

parent 2247b5bd
......@@ -8,10 +8,10 @@
<column name="object_id" type="Long" nullable="false" length="11"/>
<column name="object_last_updated_date" type="Date" nullable="false" length="22"/>
<column name="object_created_date" type="Date" nullable="false" length="22"/>
<column name="message_id" type="Long" nullable="false"/>
<column name="message_id" type="Long" nullable="true"/>
<column name="template_name" type="String" nullable="false" length="200"/>
<column name="subject" type="String" nullable="false" length="200"/>
<column name="application_status" type="String" nullable="false" length="200"/>
<column name="application_status" type="String" nullable="true" length="200"/>
<column name="delay_hrs" type="Long" nullable="true"/>
<column name="delay_min" type="Long" nullable="true"/>
<column name="variance" type="Long" nullable="true"/>
......
......@@ -8,10 +8,10 @@ CREATE TABLE tl_message_template (
object_last_updated_date datetime DEFAULT getdate() NOT NULL ,
object_created_date datetime DEFAULT getdate() NOT NULL
,
message_id numeric(12) NOT NULL,
message_id numeric(12) NULL,
template_name varchar(200) NOT NULL,
subject varchar(200) NOT NULL,
application_status varchar(200) NOT NULL,
application_status varchar(200) NULL,
delay_hrs numeric(12) NULL,
delay_min numeric(12) NULL,
variance numeric(12) NULL,
......
......@@ -9,10 +9,10 @@ CREATE TABLE tl_message_template (
object_last_updated_date date DEFAULT SYSDATE NOT NULL ,
object_created_date date DEFAULT SYSDATE NOT NULL
,
message_id number(12) NOT NULL,
message_id number(12) NULL,
template_name varchar2(200) NOT NULL,
subject varchar2(200) NOT NULL,
application_status varchar2(200) NOT NULL,
application_status varchar2(200) NULL,
delay_hrs number(12) NULL,
delay_min number(12) NULL,
variance number(12) NULL,
......
......@@ -9,10 +9,10 @@ CREATE TABLE tl_message_template (
object_last_updated_date timestamp DEFAULT NOW() NOT NULL ,
object_created_date timestamp DEFAULT NOW() NOT NULL
,
message_id numeric(12) NOT NULL,
message_id numeric(12) NULL,
template_name varchar(200) NOT NULL,
subject varchar(200) NOT NULL,
application_status varchar(200) NOT NULL,
application_status varchar(200) NULL,
delay_hrs numeric(12) NULL,
delay_min numeric(12) NULL,
variance numeric(12) NULL,
......
......@@ -205,7 +205,7 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
metaInfo.put ("dbcol", "message_id");
metaInfo.put ("defaultValue", "1");
metaInfo.put ("mandatory", "true");
metaInfo.put ("mandatory", "false");
metaInfo.put ("name", "MessageID");
metaInfo.put ("type", "Integer");
metaInfo.put (METADATA_DB_TABLENAME, "tl_message_template");
......@@ -263,7 +263,7 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
metaInfo.put ("attribHelper", "EnumeratedAttributeHelper");
metaInfo.put ("dbcol", "application_status");
metaInfo.put ("defaultValue", "ApplicationStatus.DRAFT");
metaInfo.put ("mandatory", "true");
metaInfo.put ("mandatory", "false");
metaInfo.put ("name", "ApplicationStatus");
metaInfo.put ("type", "ApplicationStatus");
metaInfo.put (METADATA_DB_TABLENAME, "tl_message_template");
......@@ -545,7 +545,6 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
oldAndNewIdentical = HELPER_MessageID.compare (_MessageID, newMessageID);
}
BusinessObjectParser.assertFieldCondition (newMessageID != null, this, FIELD_MessageID, "mandatory");
if (FIELD_MessageID_Validators.length > 0)
......@@ -848,7 +847,6 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
oldAndNewIdentical = HELPER_ApplicationStatus.compare (_ApplicationStatus, newApplicationStatus);
}
BusinessObjectParser.assertFieldCondition (newApplicationStatus != null, this, FIELD_ApplicationStatus, "mandatory");
if (FIELD_ApplicationStatus_Validators.length > 0)
......@@ -3015,10 +3013,10 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
List result = super.getAttributes ();
result.add(HELPER_MessageID.getAttribObject (getClass (), _MessageID, true, FIELD_MessageID));
result.add(HELPER_MessageID.getAttribObject (getClass (), _MessageID, false, FIELD_MessageID));
result.add(HELPER_TemplateName.getAttribObject (getClass (), _TemplateName, true, FIELD_TemplateName));
result.add(HELPER_Subject.getAttribObject (getClass (), _Subject, true, FIELD_Subject));
result.add(HELPER_ApplicationStatus.getAttribObject (getClass (), _ApplicationStatus, true, FIELD_ApplicationStatus));
result.add(HELPER_ApplicationStatus.getAttribObject (getClass (), _ApplicationStatus, false, FIELD_ApplicationStatus));
result.add(HELPER_DelayHrs.getAttribObject (getClass (), _DelayHrs, false, FIELD_DelayHrs));
result.add(HELPER_DelayMin.getAttribObject (getClass (), _DelayMin, false, FIELD_DelayMin));
result.add(HELPER_Variance.getAttribObject (getClass (), _Variance, false, FIELD_Variance));
......
......@@ -6,10 +6,10 @@
<IMPORT value="performa.orm.*"/>
<TABLE name="tl_message_template" tablePrefix="object" polymorphic="FALSE">
<ATTRIB name="MessageID" type="Integer" dbcol="message_id" mandatory="true" defaultValue="1"/>
<ATTRIB name="MessageID" type="Integer" dbcol="message_id" mandatory="false" defaultValue="1"/>
<ATTRIB name="TemplateName" type="String" dbcol="template_name" mandatory="true" length="200" />
<ATTRIB name="Subject" type="String" dbcol="subject" mandatory="true" length="200" />
<ATTRIB name="ApplicationStatus" type="ApplicationStatus" dbcol="application_status" mandatory="true" defaultValue="ApplicationStatus.DRAFT" attribHelper="EnumeratedAttributeHelper" />
<ATTRIB name="ApplicationStatus" type="ApplicationStatus" dbcol="application_status" mandatory="false" defaultValue="ApplicationStatus.DRAFT" attribHelper="EnumeratedAttributeHelper" />
<ATTRIB name="DelayHrs" type="Integer" dbcol="delay_hrs" mandatory="false" defaultValue="0" />
<ATTRIB name="DelayMin" type="Integer" dbcol="delay_min" mandatory="false" defaultValue="0" />
<ATTRIB name="Variance" type="Integer" dbcol="variance" mandatory="false" defaultValue="0" />
......
ALTER TABLE tl_message_template ALTER COLUMN message_id DROP NOT NULL;
ALTER TABLE tl_message_template ALTER COLUMN application_status DROP NOT NULL;
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment