Source Code Cross Referenced for SCOWrapper.java in  » Database-ORM » TJDO » com » triactive » jdo » state » 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 » Database ORM » TJDO » com.triactive.jdo.state 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright 2004 (C) TJDO.
003:         * All rights reserved.
004:         *
005:         * This software is distributed under the terms of the TJDO License version 1.0.
006:         * See the terms of the TJDO License in the documentation provided with this software.
007:         *
008:         * $Id: SCOWrapper.java,v 1.1 2004/01/18 03:01:06 jackknifebarber Exp $
009:         */
010:
011:        package com.triactive.jdo.state;
012:
013:        import com.triactive.jdo.FieldManager;
014:
015:        /**
016:         * A field manager that wraps SCO field values in appropriate SCO objects.
017:         * <p>
018:         * All calls are delegated to an underlying field manager.
019:         * Calls to {@link #fetchObjectField} are handled specially; if the field is
020:         * an SCO field the value obtained from the underlying field manager is, if
021:         * necessary, wrapped in an appropriate SCO wrapper class.
022:         *
023:         * @author <a href="mailto:mmartin5@austin.rr.com">Mike Martin</a>
024:         * @version $Revision: 1.1 $
025:         */
026:
027:        class SCOWrapper implements  FieldManager {
028:            private final FieldManager fm;
029:            private final StateManagerImpl sm;
030:            private final boolean[] isSCO;
031:
032:            /**
033:             * Constructs an SCO wrapper.
034:             *
035:             * @param fm
036:             *      The underlying field manager to which calls are delegated.
037:             * @param sm
038:             *      The state manager for the managed object.
039:             * @param isSCO
040:             *      An array of booleans, one for each field, indicating whether or not
041:             *      the field is an SCO field.
042:             */
043:
044:            public SCOWrapper(FieldManager fm, StateManagerImpl sm,
045:                    boolean[] isSCO) {
046:                this .fm = fm;
047:                this .sm = sm;
048:                this .isSCO = isSCO;
049:            }
050:
051:            public void storeBooleanField(int field, boolean value) {
052:                fm.storeBooleanField(field, value);
053:            }
054:
055:            public boolean fetchBooleanField(int field) {
056:                return fm.fetchBooleanField(field);
057:            }
058:
059:            public void storeCharField(int field, char value) {
060:                fm.storeCharField(field, value);
061:            }
062:
063:            public char fetchCharField(int field) {
064:                return fm.fetchCharField(field);
065:            }
066:
067:            public void storeByteField(int field, byte value) {
068:                fm.storeByteField(field, value);
069:            }
070:
071:            public byte fetchByteField(int field) {
072:                return fm.fetchByteField(field);
073:            }
074:
075:            public void storeShortField(int field, short value) {
076:                fm.storeShortField(field, value);
077:            }
078:
079:            public short fetchShortField(int field) {
080:                return fm.fetchShortField(field);
081:            }
082:
083:            public void storeIntField(int field, int value) {
084:                fm.storeIntField(field, value);
085:            }
086:
087:            public int fetchIntField(int field) {
088:                return fm.fetchIntField(field);
089:            }
090:
091:            public void storeLongField(int field, long value) {
092:                fm.storeLongField(field, value);
093:            }
094:
095:            public long fetchLongField(int field) {
096:                return fm.fetchLongField(field);
097:            }
098:
099:            public void storeFloatField(int field, float value) {
100:                fm.storeFloatField(field, value);
101:            }
102:
103:            public float fetchFloatField(int field) {
104:                return fm.fetchFloatField(field);
105:            }
106:
107:            public void storeDoubleField(int field, double value) {
108:                fm.storeDoubleField(field, value);
109:            }
110:
111:            public double fetchDoubleField(int field) {
112:                return fm.fetchDoubleField(field);
113:            }
114:
115:            public void storeStringField(int field, String value) {
116:                fm.storeStringField(field, value);
117:            }
118:
119:            public String fetchStringField(int field) {
120:                return fm.fetchStringField(field);
121:            }
122:
123:            public void storeObjectField(int field, Object value) {
124:                fm.storeObjectField(field, value);
125:            }
126:
127:            public Object fetchObjectField(int field) {
128:                Object value = fm.fetchObjectField(field);
129:
130:                if (isSCO[field])
131:                    return sm.wrapSCOInstance(field, value);
132:                else
133:                    return value;
134:            }
135:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.