1 2 3 package org.tigris.scarab.om; 4 5 import java.util.List ; 6 import java.util.HashMap ; 7 8 import org.apache.torque.TorqueException; 9 import org.apache.torque.om.Persistent; 10 import org.apache.torque.om.ComboKey; 11 import org.apache.torque.om.SimpleKey; 12 import org.apache.torque.om.NumberKey; 13 14 20 public class RModuleOptionManager 21 extends BaseRModuleOptionManager 22 { 23 28 public RModuleOptionManager() 29 throws TorqueException 30 { 31 super(); 32 validFields = new HashMap (); 33 validFields.put(RModuleOptionPeer.MODULE_ID, null); 34 } 35 36 protected Persistent putInstanceImpl(Persistent om) 37 throws TorqueException 38 { 39 Persistent oldOm = super.putInstanceImpl(om); 40 List listeners = (List )listenersMap.get(RModuleOptionPeer.MODULE_ID); 41 notifyListeners(listeners, oldOm, om); 42 return oldOm; 43 } 44 45 public static final RModuleOption getInstance(Integer moduleId, 46 Integer issueTypeId, Integer optionId) 47 throws TorqueException 48 { 49 SimpleKey[] keys = { 50 new NumberKey(moduleId.toString()), 51 new NumberKey(issueTypeId.toString()), 52 new NumberKey(optionId.toString()) 53 }; 54 return getInstance(new ComboKey(keys)); 55 } 56 57 public static final RModuleOption getInstance(Module module, 58 IssueType issueType, AttributeOption option) 59 throws TorqueException 60 { 61 SimpleKey[] keys = { 62 SimpleKey.keyFor(module.getModuleId()), 63 SimpleKey.keyFor(issueType.getIssueTypeId()), 64 SimpleKey.keyFor(option.getOptionId()) 65 }; 66 return getInstance(new ComboKey(keys)); 67 } 68 } 69 | Popular Tags |