From 9a021a13400704bd42b9d3ac4bcfdeb3d3d39881 Mon Sep 17 00:00:00 2001 From: Heng Sin Low Date: Sat, 8 Mar 2008 00:11:33 +0000 Subject: [PATCH] * update model class for ad_column and ad_field --- base/src/org/compiere/model/I_AD_Column.java | 13 +++ base/src/org/compiere/model/I_AD_Field.java | 41 +++++++++ base/src/org/compiere/model/X_AD_Column.java | 29 ++++++- base/src/org/compiere/model/X_AD_Field.java | 91 +++++++++++++++++++- 4 files changed, 169 insertions(+), 5 deletions(-) diff --git a/base/src/org/compiere/model/I_AD_Column.java b/base/src/org/compiere/model/I_AD_Column.java index ccf0502ae7..ac1b046b46 100644 --- a/base/src/org/compiere/model/I_AD_Column.java +++ b/base/src/org/compiere/model/I_AD_Column.java @@ -263,6 +263,19 @@ public interface I_AD_Column */ public String getHelp(); + /** Column name InfoFactoryClass */ + public static final String COLUMNNAME_InfoFactoryClass = "InfoFactoryClass"; + + /** Set Info Factory Class. + * Fully qualified class name that implements the InfoFactory interface + */ + public void setInfoFactoryClass (String InfoFactoryClass); + + /** Get Info Factory Class. + * Fully qualified class name that implements the InfoFactory interface + */ + public String getInfoFactoryClass(); + /** Column name IsAlwaysUpdateable */ public static final String COLUMNNAME_IsAlwaysUpdateable = "IsAlwaysUpdateable"; diff --git a/base/src/org/compiere/model/I_AD_Field.java b/base/src/org/compiere/model/I_AD_Field.java index f10f116d54..a3066e9309 100644 --- a/base/src/org/compiere/model/I_AD_Field.java +++ b/base/src/org/compiere/model/I_AD_Field.java @@ -112,6 +112,19 @@ public interface I_AD_Field */ public int getAD_Reference_ID(); + /** Column name AD_Reference_Value_ID */ + public static final String COLUMNNAME_AD_Reference_Value_ID = "AD_Reference_Value_ID"; + + /** Set Reference Key. + * Required to specify, if data type is Table or List + */ + public void setAD_Reference_Value_ID (int AD_Reference_Value_ID); + + /** Get Reference Key. + * Required to specify, if data type is Table or List + */ + public int getAD_Reference_Value_ID(); + /** Column name AD_Tab_ID */ public static final String COLUMNNAME_AD_Tab_ID = "AD_Tab_ID"; @@ -127,6 +140,21 @@ public interface I_AD_Field public I_AD_Tab getAD_Tab() throws Exception; + /** Column name AD_Val_Rule_ID */ + public static final String COLUMNNAME_AD_Val_Rule_ID = "AD_Val_Rule_ID"; + + /** Set Dynamic Validation. + * Dynamic Validation Rule + */ + public void setAD_Val_Rule_ID (int AD_Val_Rule_ID); + + /** Get Dynamic Validation. + * Dynamic Validation Rule + */ + public int getAD_Val_Rule_ID(); + + public I_AD_Val_Rule getAD_Val_Rule() throws Exception; + /** Column name DefaultValue */ public static final String COLUMNNAME_DefaultValue = "DefaultValue"; @@ -209,6 +237,19 @@ public interface I_AD_Field */ public String getHelp(); + /** Column name InfoFactoryClass */ + public static final String COLUMNNAME_InfoFactoryClass = "InfoFactoryClass"; + + /** Set Info Factory Class. + * Fully qualified class name that implements the InfoFactory interface + */ + public void setInfoFactoryClass (String InfoFactoryClass); + + /** Get Info Factory Class. + * Fully qualified class name that implements the InfoFactory interface + */ + public String getInfoFactoryClass(); + /** Column name IsCentrallyMaintained */ public static final String COLUMNNAME_IsCentrallyMaintained = "IsCentrallyMaintained"; diff --git a/base/src/org/compiere/model/X_AD_Column.java b/base/src/org/compiere/model/X_AD_Column.java index fd167a2813..b339329d84 100644 --- a/base/src/org/compiere/model/X_AD_Column.java +++ b/base/src/org/compiere/model/X_AD_Column.java @@ -176,7 +176,7 @@ public class X_AD_Column extends PO implements I_AD_Column, I_Persistent */ public void setAD_Process_ID (int AD_Process_ID) { - if (AD_Process_ID <= 0) + if (AD_Process_ID < 1) set_Value (COLUMNNAME_AD_Process_ID, null); else set_Value (COLUMNNAME_AD_Process_ID, Integer.valueOf(AD_Process_ID)); @@ -225,7 +225,7 @@ public class X_AD_Column extends PO implements I_AD_Column, I_Persistent */ public void setAD_Reference_Value_ID (int AD_Reference_Value_ID) { - if (AD_Reference_Value_ID <= 0) + if (AD_Reference_Value_ID < 1) set_Value (COLUMNNAME_AD_Reference_Value_ID, null); else set_Value (COLUMNNAME_AD_Reference_Value_ID, Integer.valueOf(AD_Reference_Value_ID)); @@ -302,7 +302,7 @@ public class X_AD_Column extends PO implements I_AD_Column, I_Persistent */ public void setAD_Val_Rule_ID (int AD_Val_Rule_ID) { - if (AD_Val_Rule_ID <= 0) + if (AD_Val_Rule_ID < 1) set_Value (COLUMNNAME_AD_Val_Rule_ID, null); else set_Value (COLUMNNAME_AD_Val_Rule_ID, Integer.valueOf(AD_Val_Rule_ID)); @@ -512,6 +512,29 @@ public class X_AD_Column extends PO implements I_AD_Column, I_Persistent return (String)get_Value(COLUMNNAME_Help); } + /** Set Info Factory Class. + @param InfoFactoryClass + Fully qualified class name that implements the InfoFactory interface + */ + public void setInfoFactoryClass (String InfoFactoryClass) + { + + if (InfoFactoryClass != null && InfoFactoryClass.length() > 255) + { + log.warning("Length > 255 - truncated"); + InfoFactoryClass = InfoFactoryClass.substring(0, 255); + } + set_Value (COLUMNNAME_InfoFactoryClass, InfoFactoryClass); + } + + /** Get Info Factory Class. + @return Fully qualified class name that implements the InfoFactory interface + */ + public String getInfoFactoryClass () + { + return (String)get_Value(COLUMNNAME_InfoFactoryClass); + } + /** Set Always Updateable. @param IsAlwaysUpdateable The column is always updateable, even if the record is not active or processed diff --git a/base/src/org/compiere/model/X_AD_Field.java b/base/src/org/compiere/model/X_AD_Field.java index b113d6e1a4..d6c107f8d9 100644 --- a/base/src/org/compiere/model/X_AD_Field.java +++ b/base/src/org/compiere/model/X_AD_Field.java @@ -148,7 +148,7 @@ public class X_AD_Field extends PO implements I_AD_Field, I_Persistent */ public void setAD_FieldGroup_ID (int AD_FieldGroup_ID) { - if (AD_FieldGroup_ID <= 0) + if (AD_FieldGroup_ID < 1) set_Value (COLUMNNAME_AD_FieldGroup_ID, null); else set_Value (COLUMNNAME_AD_FieldGroup_ID, Integer.valueOf(AD_FieldGroup_ID)); @@ -195,7 +195,7 @@ public class X_AD_Field extends PO implements I_AD_Field, I_Persistent */ public void setAD_Reference_ID (int AD_Reference_ID) { - if (AD_Reference_ID <= 0) + if (AD_Reference_ID < 1) set_Value (COLUMNNAME_AD_Reference_ID, null); else set_Value (COLUMNNAME_AD_Reference_ID, Integer.valueOf(AD_Reference_ID)); @@ -212,6 +212,31 @@ public class X_AD_Field extends PO implements I_AD_Field, I_Persistent return ii.intValue(); } + /** AD_Reference_Value_ID AD_Reference_ID=4 */ + public static final int AD_REFERENCE_VALUE_ID_AD_Reference_ID=4; + /** Set Reference Key. + @param AD_Reference_Value_ID + Required to specify, if data type is Table or List + */ + public void setAD_Reference_Value_ID (int AD_Reference_Value_ID) + { + if (AD_Reference_Value_ID < 1) + set_Value (COLUMNNAME_AD_Reference_Value_ID, null); + else + set_Value (COLUMNNAME_AD_Reference_Value_ID, Integer.valueOf(AD_Reference_Value_ID)); + } + + /** Get Reference Key. + @return Required to specify, if data type is Table or List + */ + public int getAD_Reference_Value_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_AD_Reference_Value_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + public I_AD_Tab getAD_Tab() throws Exception { Class clazz = MTable.getClass(I_AD_Tab.Table_Name); @@ -250,6 +275,45 @@ public class X_AD_Field extends PO implements I_AD_Field, I_Persistent return ii.intValue(); } + public I_AD_Val_Rule getAD_Val_Rule() throws Exception + { + Class clazz = MTable.getClass(I_AD_Val_Rule.Table_Name); + I_AD_Val_Rule result = null; + try { + Constructor constructor = null; + constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); + result = (I_AD_Val_Rule)constructor.newInstance(new Object[] {getCtx(), new Integer(getAD_Val_Rule_ID()), get_TrxName()}); + } catch (Exception e) { + log.log(Level.SEVERE, "(id) - Table=" + Table_Name + ",Class=" + clazz, e); + log.saveError("Error", "Table=" + Table_Name + ",Class=" + clazz); + throw e; + } + return result; + } + + /** Set Dynamic Validation. + @param AD_Val_Rule_ID + Dynamic Validation Rule + */ + public void setAD_Val_Rule_ID (int AD_Val_Rule_ID) + { + if (AD_Val_Rule_ID < 1) + set_Value (COLUMNNAME_AD_Val_Rule_ID, null); + else + set_Value (COLUMNNAME_AD_Val_Rule_ID, Integer.valueOf(AD_Val_Rule_ID)); + } + + /** Get Dynamic Validation. + @return Dynamic Validation Rule + */ + public int getAD_Val_Rule_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_AD_Val_Rule_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + /** Set Default Logic. @param DefaultValue Default value hierarchy, separated by ; @@ -387,6 +451,29 @@ public class X_AD_Field extends PO implements I_AD_Field, I_Persistent return (String)get_Value(COLUMNNAME_Help); } + /** Set Info Factory Class. + @param InfoFactoryClass + Fully qualified class name that implements the InfoFactory interface + */ + public void setInfoFactoryClass (String InfoFactoryClass) + { + + if (InfoFactoryClass != null && InfoFactoryClass.length() > 255) + { + log.warning("Length > 255 - truncated"); + InfoFactoryClass = InfoFactoryClass.substring(0, 255); + } + set_Value (COLUMNNAME_InfoFactoryClass, InfoFactoryClass); + } + + /** Get Info Factory Class. + @return Fully qualified class name that implements the InfoFactory interface + */ + public String getInfoFactoryClass () + { + return (String)get_Value(COLUMNNAME_InfoFactoryClass); + } + /** Set Centrally maintained. @param IsCentrallyMaintained Information maintained in System Element table