1 package org.tigris.scarab.om; 2 3 48 49 import org.apache.torque.TorqueException; 51 import org.apache.torque.om.ObjectKey; 52 import org.apache.torque.util.Criteria; 53 import com.workingdogs.village.Record; 54 import com.workingdogs.village.DataSetException; 55 56 import org.tigris.scarab.services.cache.ScarabCache; 58 59 68 public class RModuleAttributePeer 69 extends org.tigris.scarab.om.BaseRModuleAttributePeer 70 { 71 private static final String RMODULEATTRIBUTE_PEER = 72 "RModuleAttributePeer"; 73 private static final String RETRIEVE_BY_PK = 74 "retrieveByPK"; 75 76 private static final String COUNT = 77 "count(*)"; 78 79 89 public static int count(Criteria crit) 90 throws TorqueException, DataSetException 91 { 92 crit.addSelectColumn(COUNT); 93 return ((Record)IssuePeer.doSelectVillageRecords(crit).get(0)) 94 .getValue(1).asInt(); 95 } 96 97 102 public static RModuleAttribute retrieveByPK(ObjectKey pk) 103 throws TorqueException 104 { 105 RModuleAttribute result = null; 106 Object obj = ScarabCache.get(RMODULEATTRIBUTE_PEER, RETRIEVE_BY_PK, pk); 107 if (obj == null) 108 { 109 result = BaseRModuleAttributePeer.retrieveByPK(pk); 110 ScarabCache.put(result, RMODULEATTRIBUTE_PEER, RETRIEVE_BY_PK, pk); 111 } 112 else 113 { 114 result = (RModuleAttribute)obj; 115 } 116 return result; 117 } 118 119 public static void doDelete(RModuleAttribute rma) throws TorqueException 120 { 121 Criteria crit = new Criteria(); 122 crit.add(ConditionPeer.MODULE_ID, rma.getModuleId()); 123 crit.add(ConditionPeer.ISSUE_TYPE_ID, rma.getIssueTypeId()); 124 crit.add(ConditionPeer.ATTRIBUTE_ID, rma.getAttributeId()); 125 ConditionPeer.doDelete(crit); 126 BaseTransitionPeer.doDelete(crit); 127 } 128 } 129 130 | Popular Tags |