1 23 24 31 package org.enhydra.dods.trans; 32 33 import org.enhydra.dods.Common; 34 35 38 public class DefaultTagValues { 39 40 public static final String TABLE_AUTHOR = "NN"; 42 public static final String TABLE_PROJECT_NAME = "DODS Project"; 43 public static final String TABLE_TEMPLATE_SET = "standard"; 44 public static String TABLE_EXTENDS_VALUE = "com.lutris.dods.builder.generator.dataobject.GenericDO"; 45 public static String TABLE_DB_VENDOR = "Standard"; 46 public static String TABLE_STRING_MATCH = "LIKE"; 47 public static String TABLE_STRING_WILDCARD = "%"; 48 public static boolean TABLE_DELETE_CASCADE = false; 49 public static boolean MASS_UPDATES = false; 50 public static boolean MASS_DELETES = false; 51 52 public static final boolean DO_IS_OID_BASED = true; 53 public static final boolean DO_SECURITY = false; 54 public static final boolean DO_NON_SECURITY = true; 55 public static final boolean DO_MULTIDB = false; 56 public static final boolean IS_ANY_COLUMN_SECURE = false; 57 public static final boolean DATABASE_SECURITY = false; 58 public static final boolean DATABASE_NON_SECURITY = true; 59 public static final boolean DATABASE_MASS_UPDATE = false; 60 public static final boolean DATABASE_MASS_DELETE = false; 61 62 public static final boolean COLUMN_IS_REFERENCE = false; 64 public static final boolean COLUMN_REF_CONSTARINT = false; 65 public static final boolean COLUMN_REF_IS_ABSTARCT = false; 66 public static final boolean COLUMN_REF_IS_FOREIGN_KEY = false; 67 public static final String COLUMN_REF_FOREIGN_KEY_COLUMN_NAME = null; 68 public static final boolean COLUMN_IS_CONSTANT = false; 69 public static final String COLUMN_DB_TYPE = "VARCHAR"; 70 public static final String COLUMN_JAVA_TYPE = "String"; 71 public static final boolean COLUMN_USED_FOR_QUERY = true; 72 public static final boolean COLUMN_CAN_BE_NULL = false; 73 public static final boolean COLUMN_IS_PRIMARY_KEY = false; 74 public static final boolean COLUMN_IS_ARRAY = false; 75 public static final boolean COLUMN_IS_INDEX = false; 76 public static final boolean COLUMN_IS_UNIQUE = false; 77 public static final boolean COLUMN_SECURITY = false; 78 public static final boolean COLUMN_NON_SECURITY = true; 79 80 81 82 87 public static void loadDatabaseValues(String database) { 88 TABLE_DB_VENDOR = database; 89 TABLE_DELETE_CASCADE = Common.getDodsConfProperty("DeleteCascade", database).equals("true"); 90 } 91 92 100 public static String getDefaultSize(String dbType, String javaType) { 101 if (dbType.equalsIgnoreCase("VARCHAR")) { 102 return "32"; 103 } 104 if (dbType.equalsIgnoreCase("VARCHAR2")) { 105 return "32"; 106 } 107 if (dbType.equalsIgnoreCase("NVARCHAR2")) { 108 return "32"; 109 } 110 if (dbType.equalsIgnoreCase("RAW")) { 111 return "32"; 112 } 113 if (dbType.equalsIgnoreCase("CHAR")) { 114 return "32"; 115 } 116 if (dbType.equalsIgnoreCase("NCHAR")) { 117 return "32"; 118 } 119 if (dbType.equalsIgnoreCase("NUMBER")) { 120 return "19,0"; 121 } 122 if (dbType.equalsIgnoreCase("NUMERIC")) { 123 return "19,0"; 124 } 125 if (dbType.equalsIgnoreCase("BINARY")) { 126 return "8"; 127 } 128 if (javaType.equalsIgnoreCase("BigDecimal")) { 129 return "19,0"; 130 } 131 if (javaType.equalsIgnoreCase("java.math.BigDecimal")) { 132 return "19,0"; 133 } 134 return null; } 136 } 137 | Popular Tags |