1 19 package org.openharmonise.rm.resources.xml; 20 21 import java.util.*; 22 23 import org.openharmonise.commons.dsi.*; 24 import org.openharmonise.commons.dsi.dml.*; 25 import org.openharmonise.rm.dsi.*; 26 import org.openharmonise.rm.resources.*; 27 28 29 36 public class XSLResourceGroup extends AbstractParentObject { 37 38 private static final String TBL_XSL_GROUP = "xsl_group"; 40 41 public static final String TAG_XSL_GROUP = "XSLGroup"; 43 44 private static List CHILD_CLASS_NAMES = null; 46 47 static { 48 DatabaseInfo.getInstance().registerTableName( 49 XSLResourceGroup.class.getName(), 50 TBL_XSL_GROUP); 51 52 try { 53 CHILD_CLASS_NAMES = new Vector(); 54 CHILD_CLASS_NAMES.add(XSLResourceGroup.class.getName()); 55 CHILD_CLASS_NAMES.add(XSLResource.class.getName()); 56 57 } catch (Exception e) { 58 throw new RuntimeException (e.getMessage()); 59 } 60 } 61 62 65 public XSLResourceGroup() { 66 super(); 67 } 68 69 74 public XSLResourceGroup(AbstractDataStoreInterface dbintrf) { 75 super(dbintrf); 76 } 77 78 84 public XSLResourceGroup(AbstractDataStoreInterface dbintrf, int nId) { 85 super(dbintrf, nId); 86 } 87 88 91 public String getParentObjectClassName() { 92 return getClass().getName(); 93 } 94 95 98 public String getDBTableName() { 99 return TBL_XSL_GROUP; 100 } 101 102 105 public JoinConditions getInstanceJoinConditions( 106 String sObjectTag, 107 boolean bIsOuter) 108 throws DataStoreException { 109 JoinConditions joinConditions = new JoinConditions(); 110 DatabaseInfo dbInfo = DatabaseInfo.getInstance(); 111 String sChildTableName = null; 112 String sClassName = null; 113 114 if (sObjectTag.equals("XSLResource") == true) { 115 sChildTableName = dbInfo.getTableName(XSLResource.class.getName()); 116 sClassName = XSLResource.class.getName(); 117 } else if (sObjectTag.equals("XSLResourceGroup") == true) { 118 sChildTableName = dbInfo.getTableName(XSLResourceGroup.class.getName()); 119 sClassName = XSLResourceGroup.class.getName(); 120 } else { 121 throw new DataStoreException("Invalid child object."); 122 } 123 124 ColumnRef childKeyCol = getGroupChildJoinColumnRef(sChildTableName, CLMN_CHILD_KEY); 126 ColumnRef parentKeyCol = getGroupChildJoinColumnRef(sChildTableName, CLMN_PARENT_KEY); 127 128 joinConditions.addCondition(getInstanceColumnRef(AbstractObject.ATTRIB_KEY, false), parentKeyCol); 129 if (sObjectTag.equals("XSLResource") == true) { 130 joinConditions.addCondition(XSLResource.getColumnRef(sClassName, AbstractObject.ATTRIB_KEY, false), childKeyCol); 131 } else if (sObjectTag.equals("XSLResourceGroup") == true) { 132 joinConditions.addCondition(getColumnRef(sClassName, AbstractObject.ATTRIB_KEY, false), childKeyCol); 133 } 134 135 return joinConditions; 136 } 137 138 141 public String getTagName() { 142 143 return TAG_XSL_GROUP; 144 } 145 146 149 150 153 public List getChildClassNames() { 154 return CHILD_CLASS_NAMES; 155 } 156 157 } 158 | Popular Tags |