[ 1887651 ] Add Ad_Reference_Value_ID and AD_Val_Rule_ID to AD_Field

[ 1892335 ] Define custom info class at ad_column or ad_field
This commit is contained in:
Heng Sin Low 2008-02-13 09:21:44 +00:00
parent 8da616ddfd
commit 2a60faf4b1
4 changed files with 72 additions and 68 deletions

View File

@ -8,7 +8,7 @@ CREATE OR REPLACE VIEW AD_FIELD_V
CALLOUT, AD_REFERENCE_ID, AD_VAL_RULE_ID, AD_PROCESS_ID, ISALWAYSUPDATEABLE,
READONLYLOGIC, MANDATORYLOGIC, ISUPDATEABLE, ISENCRYPTEDCOLUMN, ISSELECTIONCOLUMN,
TABLENAME, VALUEMIN, VALUEMAX, FIELDGROUP, VALIDATIONCODE,
INCLUDED_TAB_ID, FIELDGROUPTYPE, IsCollapsedByDefault)
INCLUDED_TAB_ID, FIELDGROUPTYPE, IsCollapsedByDefault, InfoFactoryClass)
AS
SELECT t.AD_Window_ID, f.AD_Tab_ID, f.AD_Field_ID, tbl.AD_Table_ID, f.AD_Column_ID,
f.NAME, f.Description, f.Help, f.IsDisplayed, f.DisplayLogic, f.DisplayLength,
@ -18,20 +18,21 @@ SELECT t.AD_Window_ID, f.AD_Tab_ID, f.AD_Field_ID, tbl.AD_Table_ID, f.AD_Column_
COALESCE(f.DefaultValue, c.DefaultValue) AS DefaultValue,
c.IsKey, c.IsParent,
COALESCE(f.IsMandatory, c.IsMandatory) AS IsMandatory,
c.IsIdentifier, c.IsTranslated, c.AD_Reference_Value_ID,
c.IsIdentifier, c.IsTranslated, COALESCE(f.AD_Reference_Value_ID, c.AD_Reference_Value_ID) AS AD_Reference_Value_ID,
c.Callout, COALESCE(f.AD_Reference_ID, c.AD_Reference_ID) AS AD_Reference_ID,
c.AD_Val_Rule_ID, c.AD_Process_ID, c.IsAlwaysUpdateable,
COALESCE(f.AD_Val_Rule_ID, c.AD_Val_Rule_ID) AS AD_Val_Rule_ID, c.AD_Process_ID, c.IsAlwaysUpdateable,
c.ReadOnlyLogic, c.MandatoryLogic, c.IsUpdateable, c.IsEncrypted AS IsEncryptedColumn,
c.IsSelectionColumn,
tbl.TableName, c.ValueMin, c.ValueMax,
fg.NAME AS FieldGroup, vr.Code AS ValidationCode,
f.Included_Tab_ID, fg.FieldGroupType, fg.IsCollapsedByDefault
f.Included_Tab_ID, fg.FieldGroupType, fg.IsCollapsedByDefault,
COALESCE(f.InfoFactoryClass, c.InfoFactoryClass) as InfoFactoryClass
FROM AD_FIELD f
INNER JOIN AD_TAB t ON (f.AD_Tab_ID = t.AD_Tab_ID)
LEFT OUTER JOIN AD_FIELDGROUP fg ON (f.AD_FieldGroup_ID = fg.AD_FieldGroup_ID)
LEFT OUTER JOIN AD_COLUMN c ON (f.AD_Column_ID = c.AD_Column_ID)
INNER JOIN AD_TABLE tbl ON (c.AD_Table_ID = tbl.AD_Table_ID)
INNER JOIN AD_REFERENCE r ON (c.AD_Reference_ID = r.AD_Reference_ID)
LEFT OUTER JOIN AD_VAL_RULE vr ON (c.AD_Val_Rule_ID=vr.AD_Val_Rule_ID)
LEFT OUTER JOIN AD_VAL_RULE vr ON (vr.AD_Val_Rule_ID = COALESCE(f.AD_Val_Rule_ID, c.AD_Val_Rule_ID))
WHERE f.IsActive = 'Y'
AND c.IsActive = 'Y'

View File

@ -8,7 +8,7 @@ CREATE OR REPLACE VIEW AD_FIELD_VT
AD_REFERENCE_VALUE_ID, CALLOUT, AD_REFERENCE_ID, AD_VAL_RULE_ID, AD_PROCESS_ID,
ISALWAYSUPDATEABLE, READONLYLOGIC, MANDATORYLOGIC, ISUPDATEABLE, ISENCRYPTEDCOLUMN,
ISSELECTIONCOLUMN, TABLENAME, VALUEMIN, VALUEMAX, FIELDGROUP,
VALIDATIONCODE, INCLUDED_TAB_ID, FIELDGROUPTYPE, IsCollapsedByDefault)
VALIDATIONCODE, INCLUDED_TAB_ID, FIELDGROUPTYPE, IsCollapsedByDefault, InfoFactoryClass)
AS
SELECT trl.AD_LANGUAGE, t.AD_Window_ID, f.AD_Tab_ID, f.AD_Field_ID, tbl.AD_Table_ID, f.AD_Column_ID,
trl.NAME, trl.Description, trl.Help, f.IsDisplayed, f.DisplayLogic, f.DisplayLength,
@ -18,13 +18,14 @@ SELECT trl.AD_LANGUAGE, t.AD_Window_ID, f.AD_Tab_ID, f.AD_Field_ID, tbl.AD_Table
COALESCE(f.DefaultValue, c.DefaultValue) AS DefaultValue,
c.IsKey, c.IsParent,
COALESCE(f.IsMandatory, c.IsMandatory) AS IsMandatory,
c.IsIdentifier, c.IsTranslated, c.AD_Reference_Value_ID,
c.IsIdentifier, c.IsTranslated, COALESCE(f.AD_Reference_Value_ID, c.AD_Reference_Value_ID) AS AD_Reference_Value_ID,
c.Callout, COALESCE(f.AD_Reference_ID, c.AD_Reference_ID) AS AD_Reference_ID,
c.AD_Val_Rule_ID, c.AD_Process_ID, c.IsAlwaysUpdateable,
COALESCE(f.AD_Val_Rule_ID, c.AD_Val_Rule_ID) as AD_Val_Rule_ID, c.AD_Process_ID, c.IsAlwaysUpdateable,
c.ReadOnlyLogic, c.MandatoryLogic, c.IsUpdateable, c.IsEncrypted AS IsEncryptedColumn, c.IsSelectionColumn,
tbl.TableName, c.ValueMin, c.ValueMax,
fgt.NAME AS FieldGroup, vr.Code AS ValidationCode,
f.Included_Tab_ID, fg.FieldGroupType, fg.IsCollapsedByDefault
f.Included_Tab_ID, fg.FieldGroupType, fg.IsCollapsedByDefault,
COALESCE(f.InfoFactoryClass, c.InfoFactoryClass) as InfoFactoryClass
FROM AD_FIELD f
INNER JOIN AD_FIELD_TRL trl ON (f.AD_Field_ID = trl.AD_Field_ID)
INNER JOIN AD_TAB t ON (f.AD_Tab_ID = t.AD_Tab_ID)
@ -34,6 +35,6 @@ FROM AD_FIELD f
LEFT OUTER JOIN AD_COLUMN c ON (f.AD_Column_ID = c.AD_Column_ID)
INNER JOIN AD_TABLE tbl ON (c.AD_Table_ID = tbl.AD_Table_ID)
INNER JOIN AD_REFERENCE r ON (c.AD_Reference_ID = r.AD_Reference_ID)
LEFT OUTER JOIN AD_VAL_RULE vr ON (c.AD_Val_Rule_ID=vr.AD_Val_Rule_ID)
LEFT OUTER JOIN AD_VAL_RULE vr ON (vr.AD_Val_Rule_ID=COALESCE(f.AD_Val_Rule_ID, c.AD_Val_Rule_ID))
WHERE f.IsActive = 'Y'
AND c.IsActive = 'Y'

View File

@ -19,46 +19,47 @@ SELECT t.ad_window_id,
f.isreadonly,
f.isencrypted AS isencryptedfield,
f.obscuretype,
C.columnname,
C.columnsql,
C.fieldlength,
C.vformat,
C.defaultvalue,
C.iskey,
C.isparent,
COALESCE(f.ismandatory, C.ismandatory) AS ismandatory,
C.isidentifier,
C.istranslated,
C.ad_reference_value_id,
C.callout,
COALESCE(f.ad_reference_id, C.ad_reference_id) AS ad_reference_id,
C.ad_val_rule_id,
C.ad_process_id,
C.isalwaysupdateable,
C.readonlylogic,
C.isupdateable,
C.isencrypted AS isencryptedcolumn,
C.isselectioncolumn,
c.columnname,
c.columnsql,
c.fieldlength,
c.vformat,
c.defaultvalue,
c.iskey,
c.isparent,
COALESCE(f.ismandatory, c.ismandatory) AS ismandatory,
c.isidentifier,
c.istranslated,
COALESCE(f.ad_reference_value_id, c.ad_reference_value_id) AS ad_reference_value_id,
c.callout,
COALESCE(f.ad_reference_id, c.ad_reference_id) AS ad_reference_id,
COALESCE(f.ad_val_rule_id, c.ad_val_rule_id) AS ad_val_rule_id,
c.ad_process_id,
c.isalwaysupdateable,
c.readonlylogic,
c.isupdateable,
c.isencrypted AS isencryptedcolumn,
c.isselectioncolumn,
tbl.tablename,
C.valuemin,
C.valuemax,
c.valuemin,
c.valuemax,
fg.NAME AS fieldgroup,
vr.code AS validationcode,
f.Included_Tab_ID,
fg.FieldGroupType,
fg.IsCollapsedByDefault AS iscollapsedbydefault
fg.IsCollapsedByDefault AS iscollapsedbydefault,
COALESCE(f.infofactoryclass, c.infofactoryclass) as infofactoryclass
FROM ((((((AD_FIELD f
JOIN AD_TAB t
ON ((f.ad_tab_id = t.ad_tab_id)))
LEFT JOIN AD_FIELDGROUP fg
ON ((f.ad_fieldgroup_id = fg.ad_fieldgroup_id)))
LEFT JOIN AD_COLUMN C
ON ((f.ad_column_id = C.ad_column_id)))
LEFT JOIN AD_COLUMN c
ON ((f.ad_column_id = c.ad_column_id)))
JOIN AD_TABLE tbl
ON ((C.ad_table_id = tbl.ad_table_id)))
ON ((c.ad_table_id = tbl.ad_table_id)))
JOIN AD_REFERENCE r
ON ((C.ad_reference_id = r.ad_reference_id)))
ON ((c.ad_reference_id = r.ad_reference_id)))
LEFT JOIN AD_VAL_RULE vr
ON ((C.ad_val_rule_id = vr.ad_val_rule_id)))
ON ((vr.ad_val_rule_id = COALESCE(f.ad_val_rule_id, c.ad_val_rule_id))))
WHERE ((f.isactive = 'Y'::bpchar) AND
(C.isactive = 'Y'::bpchar))
(c.isactive = 'Y'::bpchar))

View File

@ -20,34 +20,35 @@ SELECT trl.AD_LANGUAGE,
f.isreadonly,
f.isencrypted AS isencryptedfield,
f.obscuretype,
C.columnname,
C.columnsql,
C.fieldlength,
C.vformat,
C.defaultvalue,
C.iskey,
C.isparent,
COALESCE(f.ismandatory, C.ismandatory) AS ismandatory,
C.isidentifier,
C.istranslated,
C.ad_reference_value_id,
C.callout,
COALESCE(f.ad_reference_id, C.ad_reference_id) AS ad_reference_id,
C.ad_val_rule_id,
C.ad_process_id,
C.isalwaysupdateable,
C.readonlylogic,
C.isupdateable,
C.isencrypted AS isencryptedcolumn,
C.isselectioncolumn,
c.columnname,
c.columnsql,
c.fieldlength,
c.vformat,
c.defaultvalue,
c.iskey,
c.isparent,
COALESCE(f.ismandatory, c.ismandatory) AS ismandatory,
c.isidentifier,
c.istranslated,
COALESCE(f.ad_reference_value_id, c.ad_reference_value_id) AS ad_reference_value_id,
c.callout,
COALESCE(f.ad_reference_id, c.ad_reference_id) AS ad_reference_id,
COALESCE(f.ad_val_rule_id, c.ad_val_rule_id) AS ad_val_rule_id,
c.ad_process_id,
c.isalwaysupdateable,
c.readonlylogic,
c.isupdateable,
c.isencrypted AS isencryptedcolumn,
c.isselectioncolumn,
tbl.tablename,
C.valuemin,
C.valuemax,
c.valuemin,
c.valuemax,
fgt.NAME AS fieldgroup,
vr.code AS validationcode,
f.Included_Tab_ID,
fg.FieldGroupType,
fg.IsCollapsedByDefault AS iscollapsedbydefault
fg.IsCollapsedByDefault AS iscollapsedbydefault ,
COALESCE(f.infofactoryclass, c.infofactoryclass) as infofactoryclass
FROM (((((((AD_FIELD f
JOIN AD_FIELD_TRL trl
ON ((f.ad_field_id = trl.ad_field_id)))
@ -58,13 +59,13 @@ FROM (((((((AD_FIELD f
LEFT JOIN AD_FIELDGROUP_TRL fgt
ON (((f.ad_fieldgroup_id = fgt.ad_fieldgroup_id) AND
((trl.AD_LANGUAGE)::text = (fgt.AD_LANGUAGE)::text))))
LEFT JOIN AD_COLUMN C
ON ((f.ad_column_id = C.ad_column_id)))
LEFT JOIN AD_COLUMN c
ON ((f.ad_column_id = c.ad_column_id)))
JOIN AD_TABLE tbl
ON ((C.ad_table_id = tbl.ad_table_id)))
ON ((c.ad_table_id = tbl.ad_table_id)))
JOIN AD_REFERENCE r
ON ((C.ad_reference_id = r.ad_reference_id)))
ON ((c.ad_reference_id = r.ad_reference_id)))
LEFT JOIN AD_VAL_RULE vr
ON ((C.ad_val_rule_id = vr.ad_val_rule_id)))
ON ((vr.ad_val_rule_id = COALESCE(f.ad_val_rule_id, c.ad_val_rule_id))))
WHERE ((f.isactive = 'Y'::bpchar) AND
(C.isactive = 'Y'::bpchar))
(c.isactive = 'Y'::bpchar))