1 19 package org.openharmonise.rm.resources.publishing; 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 30 31 38 public class WebPageGroup extends AbstractParentObject { 39 40 41 private static final String TBL_PAGEGROUP = "page_group"; 43 44 public static final String TAG_PAGEGROUP = "PageGroup"; 46 47 private static List CHILD_CLASS_NAMES = null; 48 49 50 static { 51 DatabaseInfo.getInstance().registerTableName(WebPageGroup.class.getName(),TBL_PAGEGROUP); 52 53 try { 54 CHILD_CLASS_NAMES = new Vector(); 55 CHILD_CLASS_NAMES.add(WebPage.class.getName()); 56 CHILD_CLASS_NAMES.add(WebPageGroup.class.getName()); 57 58 } catch (Exception e) { 59 throw new RuntimeException (e.getMessage()); 60 } 61 } 62 63 66 public WebPageGroup() { 67 super(); 68 } 69 70 75 public WebPageGroup(AbstractDataStoreInterface dbintrf) { 76 super(dbintrf); 77 } 78 79 86 public WebPageGroup( 87 AbstractDataStoreInterface dbintrf, 88 int nId, 89 int nKey, 90 boolean bIsHist) { 91 super(dbintrf, nId, nKey, bIsHist); 92 } 93 94 100 public WebPageGroup(AbstractDataStoreInterface dbintrf, int nId) { 101 super(dbintrf, nId); 102 } 103 104 105 108 public String getParentObjectClassName() { 109 return getClass().getName(); 110 } 111 112 115 public String getDBTableName() { 116 return TBL_PAGEGROUP; 117 } 118 119 122 public JoinConditions getInstanceJoinConditions(String sObjectTag, boolean bIsOuter) throws DataStoreException { 123 JoinConditions joinConditions = new JoinConditions(); 124 DatabaseInfo dbInfo = DatabaseInfo.getInstance(); 125 String sChildTableName = null; 126 String sClassName = null; 127 128 if (sObjectTag.equals("WebPage") == true) { 129 sChildTableName = dbInfo.getTableName(WebPage.class.getName()); 130 sClassName = WebPage.class.getName(); 131 } else if (sObjectTag.equals("WebPageGroup") == true) { 132 sChildTableName = dbInfo.getTableName(WebPageGroup.class.getName()); 133 sClassName = WebPageGroup.class.getName(); 134 } else { 135 throw new DataStoreException("Invalid child object."); 136 } 137 138 ColumnRef childKeyCol = getGroupChildJoinColumnRef(sChildTableName, CLMN_CHILD_KEY); 140 ColumnRef parentKeyCol = getGroupChildJoinColumnRef(sChildTableName, CLMN_PARENT_KEY); 141 142 joinConditions.addCondition(getInstanceColumnRef(AbstractObject.ATTRIB_KEY, false), parentKeyCol); 143 if (sObjectTag.equals("WebPage") == true) { 144 joinConditions.addCondition(WebPage.getColumnRef(sClassName, AbstractObject.ATTRIB_KEY, false), childKeyCol); 145 } else if (sObjectTag.equals("WebPageGroup") == true) { 146 joinConditions.addCondition(getColumnRef(sClassName, AbstractObject.ATTRIB_KEY, false), childKeyCol); 147 } 148 149 return joinConditions; 150 } 151 152 155 public String getTagName() { 156 157 return TAG_PAGEGROUP; 158 } 159 160 163 164 167 public List getChildClassNames() { 168 return CHILD_CLASS_NAMES; 169 } 170 171 } 172 | Popular Tags |