Source Code Cross Referenced for BaseRModuleUserAttribute.java in  » Issue-Tracking » scarab-0.21 » org » tigris » scarab » om » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Issue Tracking » scarab 0.21 » org.tigris.scarab.om 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package org.tigris.scarab.om;
002:
003:        import java.math.BigDecimal;
004:        import java.sql.Connection;
005:        import java.util.ArrayList;
006:        import java.util.Collections;
007:        import java.util.Date;
008:        import java.util.List;
009:
010:        import org.apache.commons.lang.ObjectUtils;
011:        import org.apache.fulcrum.intake.Retrievable;
012:        import org.apache.torque.TorqueException;
013:        import org.apache.torque.om.BaseObject;
014:        import org.apache.torque.om.ComboKey;
015:        import org.apache.torque.om.DateKey;
016:        import org.apache.torque.om.NumberKey;
017:        import org.apache.torque.om.ObjectKey;
018:        import org.apache.torque.om.SimpleKey;
019:        import org.apache.torque.om.StringKey;
020:        import org.apache.torque.om.Persistent;
021:        import org.apache.torque.util.Criteria;
022:        import org.apache.torque.util.Transaction;
023:
024:        /**
025:         * You should not use this class directly.  It should not even be
026:         * extended all references should be to RModuleUserAttribute
027:         */
028:        public abstract class BaseRModuleUserAttribute extends BaseObject
029:                implements  org.apache.fulcrum.intake.Retrievable {
030:            /** The Peer class */
031:            private static final RModuleUserAttributePeer peer = new RModuleUserAttributePeer();
032:
033:            /** The value for the rmuaId field */
034:            private Long rmuaId;
035:
036:            /** The value for the listId field */
037:            private Long listId;
038:
039:            /** The value for the moduleId field */
040:            private Integer moduleId;
041:
042:            /** The value for the userId field */
043:            private Integer userId;
044:
045:            /** The value for the issueTypeId field */
046:            private Integer issueTypeId;
047:
048:            /** The value for the attributeId field */
049:            private Integer attributeId;
050:
051:            /** The value for the internalAttribute field */
052:            private String internalAttribute;
053:
054:            /** The value for the order field */
055:            private int order = 0;
056:
057:            /**
058:             * Get the RmuaId
059:             *
060:             * @return Long
061:             */
062:            public Long getRmuaId() {
063:                return rmuaId;
064:            }
065:
066:            /**
067:             * Set the value of RmuaId
068:             *
069:             * @param v new value
070:             */
071:            public void setRmuaId(Long v) {
072:
073:                if (!ObjectUtils.equals(this .rmuaId, v)) {
074:                    this .rmuaId = v;
075:                    setModified(true);
076:                }
077:
078:            }
079:
080:            /**
081:             * Get the ListId
082:             *
083:             * @return Long
084:             */
085:            public Long getListId() {
086:                return listId;
087:            }
088:
089:            /**
090:             * Set the value of ListId
091:             *
092:             * @param v new value
093:             */
094:            public void setListId(Long v) throws TorqueException {
095:
096:                if (!ObjectUtils.equals(this .listId, v)) {
097:                    this .listId = v;
098:                    setModified(true);
099:                }
100:
101:                if (aMITList != null
102:                        && !ObjectUtils.equals(aMITList.getListId(), v)) {
103:                    aMITList = null;
104:                }
105:
106:            }
107:
108:            /**
109:             * Get the ModuleId
110:             *
111:             * @return Integer
112:             */
113:            public Integer getModuleId() {
114:                return moduleId;
115:            }
116:
117:            /**
118:             * Set the value of ModuleId
119:             *
120:             * @param v new value
121:             */
122:            public void setModuleId(Integer v) throws TorqueException {
123:
124:                if (!ObjectUtils.equals(this .moduleId, v)) {
125:                    this .moduleId = v;
126:                    setModified(true);
127:                }
128:
129:                if (aModule != null
130:                        && !ObjectUtils.equals(aModule.getModuleId(), v)) {
131:                    aModule = null;
132:                }
133:
134:            }
135:
136:            /**
137:             * Get the UserId
138:             *
139:             * @return Integer
140:             */
141:            public Integer getUserId() {
142:                return userId;
143:            }
144:
145:            /**
146:             * Set the value of UserId
147:             *
148:             * @param v new value
149:             */
150:            public void setUserId(Integer v) throws TorqueException {
151:
152:                if (!ObjectUtils.equals(this .userId, v)) {
153:                    this .userId = v;
154:                    setModified(true);
155:                }
156:
157:                if (aScarabUser != null
158:                        && !ObjectUtils.equals(aScarabUser.getUserId(), v)) {
159:                    aScarabUser = null;
160:                }
161:
162:            }
163:
164:            /**
165:             * Get the IssueTypeId
166:             *
167:             * @return Integer
168:             */
169:            public Integer getIssueTypeId() {
170:                return issueTypeId;
171:            }
172:
173:            /**
174:             * Set the value of IssueTypeId
175:             *
176:             * @param v new value
177:             */
178:            public void setIssueTypeId(Integer v) throws TorqueException {
179:
180:                if (!ObjectUtils.equals(this .issueTypeId, v)) {
181:                    this .issueTypeId = v;
182:                    setModified(true);
183:                }
184:
185:                if (aIssueType != null
186:                        && !ObjectUtils.equals(aIssueType.getIssueTypeId(), v)) {
187:                    aIssueType = null;
188:                }
189:
190:            }
191:
192:            /**
193:             * Get the AttributeId
194:             *
195:             * @return Integer
196:             */
197:            public Integer getAttributeId() {
198:                return attributeId;
199:            }
200:
201:            /**
202:             * Set the value of AttributeId
203:             *
204:             * @param v new value
205:             */
206:            public void setAttributeId(Integer v) throws TorqueException {
207:
208:                if (!ObjectUtils.equals(this .attributeId, v)) {
209:                    this .attributeId = v;
210:                    setModified(true);
211:                }
212:
213:                if (aAttribute != null
214:                        && !ObjectUtils.equals(aAttribute.getAttributeId(), v)) {
215:                    aAttribute = null;
216:                }
217:
218:            }
219:
220:            /**
221:             * Get the InternalAttribute
222:             *
223:             * @return String
224:             */
225:            public String getInternalAttribute() {
226:                return internalAttribute;
227:            }
228:
229:            /**
230:             * Set the value of InternalAttribute
231:             *
232:             * @param v new value
233:             */
234:            public void setInternalAttribute(String v) {
235:
236:                if (!ObjectUtils.equals(this .internalAttribute, v)) {
237:                    this .internalAttribute = v;
238:                    setModified(true);
239:                }
240:
241:            }
242:
243:            /**
244:             * Get the Order
245:             *
246:             * @return int
247:             */
248:            public int getOrder() {
249:                return order;
250:            }
251:
252:            /**
253:             * Set the value of Order
254:             *
255:             * @param v new value
256:             */
257:            public void setOrder(int v) {
258:
259:                if (this .order != v) {
260:                    this .order = v;
261:                    setModified(true);
262:                }
263:
264:            }
265:
266:            private MITList aMITList;
267:
268:            /**
269:             * Declares an association between this object and a MITList object
270:             *
271:             * @param v MITList
272:             * @throws TorqueException
273:             */
274:            public void setMITList(MITList v) throws TorqueException {
275:                if (v == null) {
276:                    setListId((Long) null);
277:                } else {
278:                    setListId(v.getListId());
279:                }
280:                aMITList = v;
281:            }
282:
283:            /**
284:             * Returns the associated MITList object.
285:             * If it was not retrieved before, the object is retrieved from
286:             * the database
287:             *
288:             * @return the associated MITList object
289:             * @throws TorqueException
290:             */
291:            public MITList getMITList() throws TorqueException {
292:                if (aMITList == null
293:                        && (!ObjectUtils.equals(this .listId, null))) {
294:                    aMITList = MITListManager.getInstance(SimpleKey
295:                            .keyFor(this .listId));
296:                }
297:                return aMITList;
298:            }
299:
300:            /**
301:             * Return the associated MITList object
302:             * If it was not retrieved before, the object is retrieved from
303:             * the database using the passed connection
304:             *
305:             * @param connection the connection used to retrieve the associated object
306:             *        from the database, if it was not retrieved before
307:             * @return the associated MITList object
308:             * @throws TorqueException
309:             */
310:            public MITList getMITList(Connection connection)
311:                    throws TorqueException {
312:                if (aMITList == null
313:                        && (!ObjectUtils.equals(this .listId, null))) {
314:                    aMITList = MITListManager.getCachedInstance(SimpleKey
315:                            .keyFor(this .listId));
316:                    if (aMITList == null) {
317:                        aMITList = MITListPeer.retrieveByPK(SimpleKey
318:                                .keyFor(this .listId), connection);
319:                        MITListManager.putInstance(aMITList);
320:                    }
321:                }
322:                return aMITList;
323:            }
324:
325:            /**
326:             * Provides convenient way to set a relationship based on a
327:             * ObjectKey, for example
328:             * <code>bar.setFooKey(foo.getPrimaryKey())</code>
329:             *
330:             */
331:            public void setMITListKey(ObjectKey key) throws TorqueException {
332:
333:                setListId(new Long(((NumberKey) key).longValue()));
334:            }
335:
336:            private Module aModule;
337:
338:            /**
339:             * Declares an association between this object and a Module object
340:             *
341:             * @param v Module
342:             * @throws TorqueException
343:             */
344:            public void setModule(Module v) throws TorqueException {
345:                if (v == null) {
346:                    setModuleId((Integer) null);
347:                } else {
348:                    setModuleId(v.getModuleId());
349:                }
350:                aModule = v;
351:            }
352:
353:            /**
354:             * Returns the associated Module object.
355:             * If it was not retrieved before, the object is retrieved from
356:             * the database
357:             *
358:             * @return the associated Module object
359:             * @throws TorqueException
360:             */
361:            public Module getModule() throws TorqueException {
362:                if (aModule == null
363:                        && (!ObjectUtils.equals(this .moduleId, null))) {
364:                    aModule = ModuleManager.getInstance(SimpleKey
365:                            .keyFor(this .moduleId));
366:                }
367:                return aModule;
368:            }
369:
370:            /**
371:             * Return the associated Module object
372:             * If it was not retrieved before, the object is retrieved from
373:             * the database using the passed connection
374:             *
375:             * @param connection the connection used to retrieve the associated object
376:             *        from the database, if it was not retrieved before
377:             * @return the associated Module object
378:             * @throws TorqueException
379:             */
380:            public Module getModule(Connection connection)
381:                    throws TorqueException {
382:                if (aModule == null
383:                        && (!ObjectUtils.equals(this .moduleId, null))) {
384:                    aModule = ModuleManager.getCachedInstance(SimpleKey
385:                            .keyFor(this .moduleId));
386:                    if (aModule == null) {
387:                        aModule = ScarabModulePeer.retrieveByPK(SimpleKey
388:                                .keyFor(this .moduleId), connection);
389:                        ModuleManager.putInstance(aModule);
390:                    }
391:                }
392:                return aModule;
393:            }
394:
395:            /**
396:             * Provides convenient way to set a relationship based on a
397:             * ObjectKey, for example
398:             * <code>bar.setFooKey(foo.getPrimaryKey())</code>
399:             *
400:             */
401:            public void setModuleKey(ObjectKey key) throws TorqueException {
402:
403:                setModuleId(new Integer(((NumberKey) key).intValue()));
404:            }
405:
406:            private ScarabUser aScarabUser;
407:
408:            /**
409:             * Declares an association between this object and a ScarabUser object
410:             *
411:             * @param v ScarabUser
412:             * @throws TorqueException
413:             */
414:            public void setScarabUser(ScarabUser v) throws TorqueException {
415:                if (v == null) {
416:                    setUserId((Integer) null);
417:                } else {
418:                    setUserId(v.getUserId());
419:                }
420:                aScarabUser = v;
421:            }
422:
423:            /**
424:             * Returns the associated ScarabUser object.
425:             * If it was not retrieved before, the object is retrieved from
426:             * the database
427:             *
428:             * @return the associated ScarabUser object
429:             * @throws TorqueException
430:             */
431:            public ScarabUser getScarabUser() throws TorqueException {
432:                if (aScarabUser == null
433:                        && (!ObjectUtils.equals(this .userId, null))) {
434:                    aScarabUser = ScarabUserManager.getInstance(SimpleKey
435:                            .keyFor(this .userId));
436:                }
437:                return aScarabUser;
438:            }
439:
440:            /**
441:             * Return the associated ScarabUser object
442:             * If it was not retrieved before, the object is retrieved from
443:             * the database using the passed connection
444:             *
445:             * @param connection the connection used to retrieve the associated object
446:             *        from the database, if it was not retrieved before
447:             * @return the associated ScarabUser object
448:             * @throws TorqueException
449:             */
450:            public ScarabUser getScarabUser(Connection connection)
451:                    throws TorqueException {
452:                if (aScarabUser == null
453:                        && (!ObjectUtils.equals(this .userId, null))) {
454:                    aScarabUser = ScarabUserManager.getCachedInstance(SimpleKey
455:                            .keyFor(this .userId));
456:                    if (aScarabUser == null) {
457:                        aScarabUser = ScarabUserImplPeer
458:                                .retrieveScarabUserImplByPK(SimpleKey
459:                                        .keyFor(this .userId), connection);
460:                        ScarabUserManager.putInstance(aScarabUser);
461:                    }
462:                }
463:                return aScarabUser;
464:            }
465:
466:            /**
467:             * Provides convenient way to set a relationship based on a
468:             * ObjectKey, for example
469:             * <code>bar.setFooKey(foo.getPrimaryKey())</code>
470:             *
471:             */
472:            public void setScarabUserKey(ObjectKey key) throws TorqueException {
473:
474:                setUserId(new Integer(((NumberKey) key).intValue()));
475:            }
476:
477:            private IssueType aIssueType;
478:
479:            /**
480:             * Declares an association between this object and a IssueType object
481:             *
482:             * @param v IssueType
483:             * @throws TorqueException
484:             */
485:            public void setIssueType(IssueType v) throws TorqueException {
486:                if (v == null) {
487:                    setIssueTypeId((Integer) null);
488:                } else {
489:                    setIssueTypeId(v.getIssueTypeId());
490:                }
491:                aIssueType = v;
492:            }
493:
494:            /**
495:             * Returns the associated IssueType object.
496:             * If it was not retrieved before, the object is retrieved from
497:             * the database
498:             *
499:             * @return the associated IssueType object
500:             * @throws TorqueException
501:             */
502:            public IssueType getIssueType() throws TorqueException {
503:                if (aIssueType == null
504:                        && (!ObjectUtils.equals(this .issueTypeId, null))) {
505:                    aIssueType = IssueTypeManager.getInstance(SimpleKey
506:                            .keyFor(this .issueTypeId));
507:                }
508:                return aIssueType;
509:            }
510:
511:            /**
512:             * Return the associated IssueType object
513:             * If it was not retrieved before, the object is retrieved from
514:             * the database using the passed connection
515:             *
516:             * @param connection the connection used to retrieve the associated object
517:             *        from the database, if it was not retrieved before
518:             * @return the associated IssueType object
519:             * @throws TorqueException
520:             */
521:            public IssueType getIssueType(Connection connection)
522:                    throws TorqueException {
523:                if (aIssueType == null
524:                        && (!ObjectUtils.equals(this .issueTypeId, null))) {
525:                    aIssueType = IssueTypeManager.getCachedInstance(SimpleKey
526:                            .keyFor(this .issueTypeId));
527:                    if (aIssueType == null) {
528:                        aIssueType = IssueTypePeer.retrieveByPK(SimpleKey
529:                                .keyFor(this .issueTypeId), connection);
530:                        IssueTypeManager.putInstance(aIssueType);
531:                    }
532:                }
533:                return aIssueType;
534:            }
535:
536:            /**
537:             * Provides convenient way to set a relationship based on a
538:             * ObjectKey, for example
539:             * <code>bar.setFooKey(foo.getPrimaryKey())</code>
540:             *
541:             */
542:            public void setIssueTypeKey(ObjectKey key) throws TorqueException {
543:
544:                setIssueTypeId(new Integer(((NumberKey) key).intValue()));
545:            }
546:
547:            private Attribute aAttribute;
548:
549:            /**
550:             * Declares an association between this object and a Attribute object
551:             *
552:             * @param v Attribute
553:             * @throws TorqueException
554:             */
555:            public void setAttribute(Attribute v) throws TorqueException {
556:                if (v == null) {
557:                    setAttributeId((Integer) null);
558:                } else {
559:                    setAttributeId(v.getAttributeId());
560:                }
561:                aAttribute = v;
562:            }
563:
564:            /**
565:             * Returns the associated Attribute object.
566:             * If it was not retrieved before, the object is retrieved from
567:             * the database
568:             *
569:             * @return the associated Attribute object
570:             * @throws TorqueException
571:             */
572:            public Attribute getAttribute() throws TorqueException {
573:                if (aAttribute == null
574:                        && (!ObjectUtils.equals(this .attributeId, null))) {
575:                    aAttribute = AttributeManager.getInstance(SimpleKey
576:                            .keyFor(this .attributeId));
577:                }
578:                return aAttribute;
579:            }
580:
581:            /**
582:             * Return the associated Attribute object
583:             * If it was not retrieved before, the object is retrieved from
584:             * the database using the passed connection
585:             *
586:             * @param connection the connection used to retrieve the associated object
587:             *        from the database, if it was not retrieved before
588:             * @return the associated Attribute object
589:             * @throws TorqueException
590:             */
591:            public Attribute getAttribute(Connection connection)
592:                    throws TorqueException {
593:                if (aAttribute == null
594:                        && (!ObjectUtils.equals(this .attributeId, null))) {
595:                    aAttribute = AttributeManager.getCachedInstance(SimpleKey
596:                            .keyFor(this .attributeId));
597:                    if (aAttribute == null) {
598:                        aAttribute = AttributePeer.retrieveByPK(SimpleKey
599:                                .keyFor(this .attributeId), connection);
600:                        AttributeManager.putInstance(aAttribute);
601:                    }
602:                }
603:                return aAttribute;
604:            }
605:
606:            /**
607:             * Provides convenient way to set a relationship based on a
608:             * ObjectKey, for example
609:             * <code>bar.setFooKey(foo.getPrimaryKey())</code>
610:             *
611:             */
612:            public void setAttributeKey(ObjectKey key) throws TorqueException {
613:
614:                setAttributeId(new Integer(((NumberKey) key).intValue()));
615:            }
616:
617:            private static List fieldNames = null;
618:
619:            /**
620:             * Generate a list of field names.
621:             *
622:             * @return a list of field names
623:             */
624:            public static synchronized List getFieldNames() {
625:                if (fieldNames == null) {
626:                    fieldNames = new ArrayList();
627:                    fieldNames.add("RmuaId");
628:                    fieldNames.add("ListId");
629:                    fieldNames.add("ModuleId");
630:                    fieldNames.add("UserId");
631:                    fieldNames.add("IssueTypeId");
632:                    fieldNames.add("AttributeId");
633:                    fieldNames.add("InternalAttribute");
634:                    fieldNames.add("Order");
635:                    fieldNames = Collections.unmodifiableList(fieldNames);
636:                }
637:                return fieldNames;
638:            }
639:
640:            /**
641:             * Retrieves a field from the object by name passed in as a String.
642:             *
643:             * @param name field name
644:             * @return value
645:             */
646:            public Object getByName(String name) {
647:                if (name.equals("RmuaId")) {
648:                    return getRmuaId();
649:                }
650:                if (name.equals("ListId")) {
651:                    return getListId();
652:                }
653:                if (name.equals("ModuleId")) {
654:                    return getModuleId();
655:                }
656:                if (name.equals("UserId")) {
657:                    return getUserId();
658:                }
659:                if (name.equals("IssueTypeId")) {
660:                    return getIssueTypeId();
661:                }
662:                if (name.equals("AttributeId")) {
663:                    return getAttributeId();
664:                }
665:                if (name.equals("InternalAttribute")) {
666:                    return getInternalAttribute();
667:                }
668:                if (name.equals("Order")) {
669:                    return new Integer(getOrder());
670:                }
671:                return null;
672:            }
673:
674:            /**
675:             * Retrieves a field from the object by name passed in
676:             * as a String.  The String must be one of the static
677:             * Strings defined in this Class' Peer.
678:             *
679:             * @param name peer name
680:             * @return value
681:             */
682:            public Object getByPeerName(String name) {
683:                if (name.equals(RModuleUserAttributePeer.RMUA_ID)) {
684:                    return getRmuaId();
685:                }
686:                if (name.equals(RModuleUserAttributePeer.LIST_ID)) {
687:                    return getListId();
688:                }
689:                if (name.equals(RModuleUserAttributePeer.MODULE_ID)) {
690:                    return getModuleId();
691:                }
692:                if (name.equals(RModuleUserAttributePeer.USER_ID)) {
693:                    return getUserId();
694:                }
695:                if (name.equals(RModuleUserAttributePeer.ISSUE_TYPE_ID)) {
696:                    return getIssueTypeId();
697:                }
698:                if (name.equals(RModuleUserAttributePeer.ATTRIBUTE_ID)) {
699:                    return getAttributeId();
700:                }
701:                if (name.equals(RModuleUserAttributePeer.INTERNAL_ATTRIBUTE)) {
702:                    return getInternalAttribute();
703:                }
704:                if (name.equals(RModuleUserAttributePeer.PREFERRED_ORDER)) {
705:                    return new Integer(getOrder());
706:                }
707:                return null;
708:            }
709:
710:            /**
711:             * Retrieves a field from the object by Position as specified
712:             * in the xml schema.  Zero-based.
713:             *
714:             * @param pos position in xml schema
715:             * @return value
716:             */
717:            public Object getByPosition(int pos) {
718:                if (pos == 0) {
719:                    return getRmuaId();
720:                }
721:                if (pos == 1) {
722:                    return getListId();
723:                }
724:                if (pos == 2) {
725:                    return getModuleId();
726:                }
727:                if (pos == 3) {
728:                    return getUserId();
729:                }
730:                if (pos == 4) {
731:                    return getIssueTypeId();
732:                }
733:                if (pos == 5) {
734:                    return getAttributeId();
735:                }
736:                if (pos == 6) {
737:                    return getInternalAttribute();
738:                }
739:                if (pos == 7) {
740:                    return new Integer(getOrder());
741:                }
742:                return null;
743:            }
744:
745:            /**
746:             * Stores the object in the database.  If the object is new,
747:             * it inserts it; otherwise an update is performed.
748:             *
749:             * @throws TorqueException
750:             */
751:            public void save() throws TorqueException {
752:                save(RModuleUserAttributePeer.getMapBuilder().getDatabaseMap()
753:                        .getName());
754:            }
755:
756:            /**
757:             * Stores the object in the database.  If the object is new,
758:             * it inserts it; otherwise an update is performed.
759:             * Note: this code is here because the method body is
760:             * auto-generated conditionally and therefore needs to be
761:             * in this file instead of in the super class, BaseObject.
762:             *
763:             * @param dbName
764:             * @throws TorqueException
765:             */
766:            public void save(String dbName) throws TorqueException {
767:                Connection con = null;
768:                try {
769:                    con = Transaction.begin(dbName);
770:                    save(con);
771:                    Transaction.commit(con);
772:                } catch (TorqueException e) {
773:                    Transaction.safeRollback(con);
774:                    throw e;
775:                }
776:            }
777:
778:            /** flag to prevent endless save loop, if this object is referenced
779:              by another object which falls in this transaction. */
780:            private boolean alreadyInSave = false;
781:
782:            /**
783:             * Stores the object in the database.  If the object is new,
784:             * it inserts it; otherwise an update is performed.  This method
785:             * is meant to be used as part of a transaction, otherwise use
786:             * the save() method and the connection details will be handled
787:             * internally
788:             *
789:             * @param con
790:             * @throws TorqueException
791:             */
792:            public void save(Connection con) throws TorqueException {
793:                if (!alreadyInSave) {
794:                    alreadyInSave = true;
795:
796:                    // If this object has been modified, then save it to the database.
797:                    if (isModified()) {
798:                        if (isNew()) {
799:                            RModuleUserAttributePeer.doInsert(
800:                                    (RModuleUserAttribute) this , con);
801:                            setNew(false);
802:                        } else {
803:                            RModuleUserAttributePeer.doUpdate(
804:                                    (RModuleUserAttribute) this , con);
805:                        }
806:
807:                        if (isCacheOnSave()) {
808:                            RModuleUserAttributeManager.putInstance(this );
809:                        }
810:                    }
811:
812:                    alreadyInSave = false;
813:                }
814:            }
815:
816:            /**
817:             * Specify whether to cache the object after saving to the db.
818:             * This method returns true
819:             */
820:            protected boolean isCacheOnSave() {
821:                return true;
822:            }
823:
824:            /**
825:             * Set the PrimaryKey using ObjectKey.
826:             *
827:             * @param key rmuaId ObjectKey
828:             */
829:            public void setPrimaryKey(ObjectKey key)
830:
831:            {
832:                setRmuaId(new Long(((NumberKey) key).longValue()));
833:            }
834:
835:            /**
836:             * Set the PrimaryKey using a String.
837:             *
838:             * @param key
839:             */
840:            public void setPrimaryKey(String key) {
841:                setRmuaId(new Long(key));
842:            }
843:
844:            /**
845:             * returns an id that differentiates this object from others
846:             * of its class.
847:             */
848:            public ObjectKey getPrimaryKey() {
849:                return SimpleKey.keyFor(getRmuaId());
850:            }
851:
852:            /**
853:             * get an id that differentiates this object from others
854:             * of its class.
855:             */
856:            public String getQueryKey() {
857:                if (getPrimaryKey() == null) {
858:                    return "";
859:                } else {
860:                    return getPrimaryKey().toString();
861:                }
862:            }
863:
864:            /**
865:             * set an id that differentiates this object from others
866:             * of its class.
867:             */
868:            public void setQueryKey(String key) throws TorqueException {
869:                setPrimaryKey(key);
870:            }
871:
872:            /**
873:             * Makes a copy of this object.
874:             * It creates a new object filling in the simple attributes.
875:             * It then fills all the association collections and sets the
876:             * related objects to isNew=true.
877:             */
878:            public RModuleUserAttribute copy() throws TorqueException {
879:                return copyInto(new RModuleUserAttribute());
880:            }
881:
882:            protected RModuleUserAttribute copyInto(RModuleUserAttribute copyObj)
883:                    throws TorqueException {
884:                copyObj.setRmuaId(rmuaId);
885:                copyObj.setListId(listId);
886:                copyObj.setModuleId(moduleId);
887:                copyObj.setUserId(userId);
888:                copyObj.setIssueTypeId(issueTypeId);
889:                copyObj.setAttributeId(attributeId);
890:                copyObj.setInternalAttribute(internalAttribute);
891:                copyObj.setOrder(order);
892:
893:                copyObj.setRmuaId((Long) null);
894:
895:                return copyObj;
896:            }
897:
898:            /**
899:             * returns a peer instance associated with this om.  Since Peer classes
900:             * are not to have any instance attributes, this method returns the
901:             * same instance for all member of this class. The method could therefore
902:             * be static, but this would prevent one from overriding the behavior.
903:             */
904:            public RModuleUserAttributePeer getPeer() {
905:                return peer;
906:            }
907:
908:            public String toString() {
909:                StringBuffer str = new StringBuffer();
910:                str.append("RModuleUserAttribute:\n");
911:                str.append("RmuaId = ").append(getRmuaId()).append("\n");
912:                str.append("ListId = ").append(getListId()).append("\n");
913:                str.append("ModuleId = ").append(getModuleId()).append("\n");
914:                str.append("UserId = ").append(getUserId()).append("\n");
915:                str.append("IssueTypeId = ").append(getIssueTypeId()).append(
916:                        "\n");
917:                str.append("AttributeId = ").append(getAttributeId()).append(
918:                        "\n");
919:                str.append("InternalAttribute = ").append(
920:                        getInternalAttribute()).append("\n");
921:                str.append("Order = ").append(getOrder()).append("\n");
922:                return (str.toString());
923:            }
924:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.