[ 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, CALLOUT, AD_REFERENCE_ID, AD_VAL_RULE_ID, AD_PROCESS_ID, ISALWAYSUPDATEABLE,
READONLYLOGIC, MANDATORYLOGIC, ISUPDATEABLE, ISENCRYPTEDCOLUMN, ISSELECTIONCOLUMN, READONLYLOGIC, MANDATORYLOGIC, ISUPDATEABLE, ISENCRYPTEDCOLUMN, ISSELECTIONCOLUMN,
TABLENAME, VALUEMIN, VALUEMAX, FIELDGROUP, VALIDATIONCODE, TABLENAME, VALUEMIN, VALUEMAX, FIELDGROUP, VALIDATIONCODE,
INCLUDED_TAB_ID, FIELDGROUPTYPE, IsCollapsedByDefault) INCLUDED_TAB_ID, FIELDGROUPTYPE, IsCollapsedByDefault, InfoFactoryClass)
AS AS
SELECT t.AD_Window_ID, f.AD_Tab_ID, f.AD_Field_ID, tbl.AD_Table_ID, f.AD_Column_ID, 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, 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, COALESCE(f.DefaultValue, c.DefaultValue) AS DefaultValue,
c.IsKey, c.IsParent, c.IsKey, c.IsParent,
COALESCE(f.IsMandatory, c.IsMandatory) AS IsMandatory, 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.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.ReadOnlyLogic, c.MandatoryLogic, c.IsUpdateable, c.IsEncrypted AS IsEncryptedColumn,
c.IsSelectionColumn, c.IsSelectionColumn,
tbl.TableName, c.ValueMin, c.ValueMax, tbl.TableName, c.ValueMin, c.ValueMax,
fg.NAME AS FieldGroup, vr.Code AS ValidationCode, 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 FROM AD_FIELD f
INNER JOIN AD_TAB t ON (f.AD_Tab_ID = t.AD_Tab_ID) 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_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) 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_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) 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' WHERE f.IsActive = 'Y'
AND c.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, AD_REFERENCE_VALUE_ID, CALLOUT, AD_REFERENCE_ID, AD_VAL_RULE_ID, AD_PROCESS_ID,
ISALWAYSUPDATEABLE, READONLYLOGIC, MANDATORYLOGIC, ISUPDATEABLE, ISENCRYPTEDCOLUMN, ISALWAYSUPDATEABLE, READONLYLOGIC, MANDATORYLOGIC, ISUPDATEABLE, ISENCRYPTEDCOLUMN,
ISSELECTIONCOLUMN, TABLENAME, VALUEMIN, VALUEMAX, FIELDGROUP, ISSELECTIONCOLUMN, TABLENAME, VALUEMIN, VALUEMAX, FIELDGROUP,
VALIDATIONCODE, INCLUDED_TAB_ID, FIELDGROUPTYPE, IsCollapsedByDefault) VALIDATIONCODE, INCLUDED_TAB_ID, FIELDGROUPTYPE, IsCollapsedByDefault, InfoFactoryClass)
AS 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, 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, 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, COALESCE(f.DefaultValue, c.DefaultValue) AS DefaultValue,
c.IsKey, c.IsParent, c.IsKey, c.IsParent,
COALESCE(f.IsMandatory, c.IsMandatory) AS IsMandatory, 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.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, c.ReadOnlyLogic, c.MandatoryLogic, c.IsUpdateable, c.IsEncrypted AS IsEncryptedColumn, c.IsSelectionColumn,
tbl.TableName, c.ValueMin, c.ValueMax, tbl.TableName, c.ValueMin, c.ValueMax,
fgt.NAME AS FieldGroup, vr.Code AS ValidationCode, 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 FROM AD_FIELD f
INNER JOIN AD_FIELD_TRL trl ON (f.AD_Field_ID = trl.AD_Field_ID) 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) 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) 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_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) 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' WHERE f.IsActive = 'Y'
AND c.IsActive = 'Y' AND c.IsActive = 'Y'

View File

@ -19,46 +19,47 @@ SELECT t.ad_window_id,
f.isreadonly, f.isreadonly,
f.isencrypted AS isencryptedfield, f.isencrypted AS isencryptedfield,
f.obscuretype, f.obscuretype,
C.columnname, c.columnname,
C.columnsql, c.columnsql,
C.fieldlength, c.fieldlength,
C.vformat, c.vformat,
C.defaultvalue, c.defaultvalue,
C.iskey, c.iskey,
C.isparent, c.isparent,
COALESCE(f.ismandatory, C.ismandatory) AS ismandatory, COALESCE(f.ismandatory, c.ismandatory) AS ismandatory,
C.isidentifier, c.isidentifier,
C.istranslated, c.istranslated,
C.ad_reference_value_id, COALESCE(f.ad_reference_value_id, c.ad_reference_value_id) AS ad_reference_value_id,
C.callout, c.callout,
COALESCE(f.ad_reference_id, C.ad_reference_id) AS ad_reference_id, COALESCE(f.ad_reference_id, c.ad_reference_id) AS ad_reference_id,
C.ad_val_rule_id, COALESCE(f.ad_val_rule_id, c.ad_val_rule_id) AS ad_val_rule_id,
C.ad_process_id, c.ad_process_id,
C.isalwaysupdateable, c.isalwaysupdateable,
C.readonlylogic, c.readonlylogic,
C.isupdateable, c.isupdateable,
C.isencrypted AS isencryptedcolumn, c.isencrypted AS isencryptedcolumn,
C.isselectioncolumn, c.isselectioncolumn,
tbl.tablename, tbl.tablename,
C.valuemin, c.valuemin,
C.valuemax, c.valuemax,
fg.NAME AS fieldgroup, fg.NAME AS fieldgroup,
vr.code AS validationcode, vr.code AS validationcode,
f.Included_Tab_ID, f.Included_Tab_ID,
fg.FieldGroupType, fg.FieldGroupType,
fg.IsCollapsedByDefault AS iscollapsedbydefault fg.IsCollapsedByDefault AS iscollapsedbydefault,
COALESCE(f.infofactoryclass, c.infofactoryclass) as infofactoryclass
FROM ((((((AD_FIELD f FROM ((((((AD_FIELD f
JOIN AD_TAB t JOIN AD_TAB t
ON ((f.ad_tab_id = t.ad_tab_id))) ON ((f.ad_tab_id = t.ad_tab_id)))
LEFT JOIN AD_FIELDGROUP fg LEFT JOIN AD_FIELDGROUP fg
ON ((f.ad_fieldgroup_id = fg.ad_fieldgroup_id))) ON ((f.ad_fieldgroup_id = fg.ad_fieldgroup_id)))
LEFT JOIN AD_COLUMN C LEFT JOIN AD_COLUMN c
ON ((f.ad_column_id = C.ad_column_id))) ON ((f.ad_column_id = c.ad_column_id)))
JOIN AD_TABLE tbl 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 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 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 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.isreadonly,
f.isencrypted AS isencryptedfield, f.isencrypted AS isencryptedfield,
f.obscuretype, f.obscuretype,
C.columnname, c.columnname,
C.columnsql, c.columnsql,
C.fieldlength, c.fieldlength,
C.vformat, c.vformat,
C.defaultvalue, c.defaultvalue,
C.iskey, c.iskey,
C.isparent, c.isparent,
COALESCE(f.ismandatory, C.ismandatory) AS ismandatory, COALESCE(f.ismandatory, c.ismandatory) AS ismandatory,
C.isidentifier, c.isidentifier,
C.istranslated, c.istranslated,
C.ad_reference_value_id, COALESCE(f.ad_reference_value_id, c.ad_reference_value_id) AS ad_reference_value_id,
C.callout, c.callout,
COALESCE(f.ad_reference_id, C.ad_reference_id) AS ad_reference_id, COALESCE(f.ad_reference_id, c.ad_reference_id) AS ad_reference_id,
C.ad_val_rule_id, COALESCE(f.ad_val_rule_id, c.ad_val_rule_id) AS ad_val_rule_id,
C.ad_process_id, c.ad_process_id,
C.isalwaysupdateable, c.isalwaysupdateable,
C.readonlylogic, c.readonlylogic,
C.isupdateable, c.isupdateable,
C.isencrypted AS isencryptedcolumn, c.isencrypted AS isencryptedcolumn,
C.isselectioncolumn, c.isselectioncolumn,
tbl.tablename, tbl.tablename,
C.valuemin, c.valuemin,
C.valuemax, c.valuemax,
fgt.NAME AS fieldgroup, fgt.NAME AS fieldgroup,
vr.code AS validationcode, vr.code AS validationcode,
f.Included_Tab_ID, f.Included_Tab_ID,
fg.FieldGroupType, fg.FieldGroupType,
fg.IsCollapsedByDefault AS iscollapsedbydefault fg.IsCollapsedByDefault AS iscollapsedbydefault ,
COALESCE(f.infofactoryclass, c.infofactoryclass) as infofactoryclass
FROM (((((((AD_FIELD f FROM (((((((AD_FIELD f
JOIN AD_FIELD_TRL trl JOIN AD_FIELD_TRL trl
ON ((f.ad_field_id = trl.ad_field_id))) ON ((f.ad_field_id = trl.ad_field_id)))
@ -58,13 +59,13 @@ FROM (((((((AD_FIELD f
LEFT JOIN AD_FIELDGROUP_TRL fgt LEFT JOIN AD_FIELDGROUP_TRL fgt
ON (((f.ad_fieldgroup_id = fgt.ad_fieldgroup_id) AND ON (((f.ad_fieldgroup_id = fgt.ad_fieldgroup_id) AND
((trl.AD_LANGUAGE)::text = (fgt.AD_LANGUAGE)::text)))) ((trl.AD_LANGUAGE)::text = (fgt.AD_LANGUAGE)::text))))
LEFT JOIN AD_COLUMN C LEFT JOIN AD_COLUMN c
ON ((f.ad_column_id = C.ad_column_id))) ON ((f.ad_column_id = c.ad_column_id)))
JOIN AD_TABLE tbl 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 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 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 WHERE ((f.isactive = 'Y'::bpchar) AND
(C.isactive = 'Y'::bpchar)) (c.isactive = 'Y'::bpchar))