KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > tigris > scarab > om > RModuleOptionManager


1
2
3 package org.tigris.scarab.om;
4
5 import java.util.List JavaDoc;
6 import java.util.HashMap JavaDoc;
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 /**
15  * This class manages RModuleOption objects.
16  * The skeleton for this class was autogenerated by Torque * You should add additional methods to this class to meet the
17  * application requirements. This class will only be generated as
18  * long as it does not already exist in the output directory.
19  */

20 public class RModuleOptionManager
21     extends BaseRModuleOptionManager
22 {
23     /**
24      * Creates a new <code>RModuleOptionManager</code> instance.
25      *
26      * @exception TorqueException if an error occurs
27      */

28     public RModuleOptionManager()
29         throws TorqueException
30     {
31         super();
32         validFields = new HashMap JavaDoc();
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 JavaDoc listeners = (List JavaDoc)listenersMap.get(RModuleOptionPeer.MODULE_ID);
41         notifyListeners(listeners, oldOm, om);
42         return oldOm;
43     }
44
45     public static final RModuleOption getInstance(Integer JavaDoc moduleId,
46         Integer JavaDoc issueTypeId, Integer JavaDoc 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