Source Code Cross Referenced for BasicA.java in  » Database-ORM » Speedo_1.4.5 » org » objectweb » speedo » pobjects » basic » 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 » Speedo_1.4.5 » org.objectweb.speedo.pobjects.basic 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         * Copyright (C) 2001-2004 France Telecom R&D
003:         *
004:         * This library is free software; you can redistribute it and/or
005:         * modify it under the terms of the GNU Lesser General Public
006:         * License as published by the Free Software Foundation; either
007:         * version 2 of the License, or (at your option) any later version.
008:         *
009:         * This library is distributed in the hope that it will be useful,
010:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
011:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
012:         * Lesser General Public License for more details.
013:         *
014:         * You should have received a copy of the GNU Lesser General Public
015:         * License along with this library; if not, write to the Free Software
016:         * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
017:         */package org.objectweb.speedo.pobjects.basic;
018:
019:        import java.io.Serializable;
020:        import java.util.ArrayList;
021:        import java.util.Calendar;
022:        import java.util.Collection;
023:        import java.util.Date;
024:        import java.util.Iterator;
025:        import java.util.List;
026:        import java.util.Locale;
027:
028:        import javax.jdo.InstanceCallbacks;
029:        import javax.jdo.PersistenceManager;
030:        import javax.jdo.PersistenceManagerFactory;
031:        import javax.jdo.Query;
032:
033:        /**
034:         *
035:         * @author S.Chassande-Barrioz
036:         */
037:        public class BasicA implements  Serializable, InstanceCallbacks {
038:
039:            public final static int CALLBACK_INIT = 1;
040:            static String nonPersistentField1 = "static field not persistent";
041:            final static String nonPersistentField2 = "final static field not persistent";
042:            public String f1 = null;
043:            public int f2 = 0;
044:            private int privateField = -1;
045:            protected int protectedField = -2;
046:            int noModifierField = -3;
047:            private Date d;
048:            private Date d2;
049:            private long l;
050:            protected String undeclaredField;
051:            private String nonullField = "nonnull";
052:            private char[] myArrayOfchar;
053:            private int checkJdoLoad = CALLBACK_INIT;
054:            private int checkJdoStore = CALLBACK_INIT;
055:            private int checkJdoClear = CALLBACK_INIT;
056:            private int checkJdoDelete = CALLBACK_INIT;
057:            private Locale locale = Locale.getDefault();
058:
059:            public static List getAllBasicA(PersistenceManagerFactory pmf) {
060:                PersistenceManager pm = pmf.getPersistenceManager();
061:                Query q = pm.newQuery();
062:                q.setClass(BasicA.class);
063:                Collection col = (Collection) q.execute();
064:                ArrayList al = new ArrayList();
065:                for (Iterator it = col.iterator(); it.hasNext();) {
066:                    al.add(it.next());
067:                }
068:                q.closeAll();
069:                pm.close();
070:                return al;
071:            }
072:
073:            public static List getAllBasicAId(PersistenceManagerFactory pmf) {
074:                PersistenceManager pm = pmf.getPersistenceManager();
075:                Query q = pm.newQuery();
076:                q.setClass(BasicA.class);
077:                Collection col = (Collection) q.execute();
078:                ArrayList al = new ArrayList();
079:                for (Iterator it = col.iterator(); it.hasNext();) {
080:                    al.add(pm.getObjectId(it.next()));
081:                }
082:                q.closeAll();
083:                pm.close();
084:                return al;
085:            }
086:
087:            public BasicA(String f1, int f2) {
088:                this .f1 = f1;
089:                if (this .f1 != null) {
090:                    myArrayOfchar = this .f1.toCharArray();
091:                } else {
092:                    myArrayOfchar = null;
093:                }
094:                this .f2 = f2;
095:                d = getTime();
096:                l = 1234567890L;
097:                undeclaredField = f1 + "_undeclared";
098:            }
099:
100:            protected BasicA(String f1) {
101:                this ();
102:                if (d == null) {
103:                    throw new NullPointerException("d is null");
104:                }
105:                this .f1 = f1;
106:                if (this .f1 != null) {
107:                    myArrayOfchar = f1.toCharArray();
108:                } else {
109:                    myArrayOfchar = null;
110:                }
111:                d = getTime();
112:                l = 1234567890L;
113:                undeclaredField = f1 + "_undeclared";
114:            }
115:
116:            public BasicA() {
117:                d = getTime();
118:                l = 1234567890L;
119:                undeclaredField = "undeclared";
120:            }
121:
122:            public Date getTime() {
123:                return new Date(
124:                        (Calendar.getInstance().getTime().getTime() / 1000) * 1000);
125:            }
126:
127:            public String readF1() {
128:                return f1;
129:            }
130:
131:            public void writeF1(String f1) {
132:                this .f1 = f1;
133:                if (this .f1 != null) {
134:                    myArrayOfchar = f1.toCharArray();
135:                } else {
136:                    myArrayOfchar = null;
137:                }
138:            }
139:
140:            public int readF2() {
141:                return f2;
142:            }
143:
144:            public void writeF2(int f2) {
145:                this .f2 = f2;
146:            }
147:
148:            public void incF2() {
149:                this .f2 = this .f2 + 1;
150:            }
151:
152:            public String readF1_F2() {
153:                return f1 + f2;
154:            }
155:
156:            public void writeF1() {
157:                f1 = "azerty";
158:                undeclaredField = f1.toString();
159:                myArrayOfchar = this .f1.toCharArray();
160:            }
161:
162:            public void writeF2() {
163:                f2 = 1;
164:            }
165:
166:            public void writeF1_F2() {
167:                f1 = "qsdfgh";
168:                f2 = 2;
169:            }
170:
171:            public void delegateWriteF1() {
172:                writeF1();
173:            }
174:
175:            public void jdoPostLoad() {
176:                checkJdoLoad++;
177:                readF1_F2();
178:            }
179:
180:            public void jdoPreStore() {
181:                checkJdoStore++;
182:            }
183:
184:            public void jdoPreClear() {
185:                checkJdoClear++;
186:            }
187:
188:            public void jdoPreDelete() {
189:                checkJdoDelete++;
190:            }
191:
192:            public int getCheckJdoLoad() {
193:                return checkJdoLoad;
194:            }
195:
196:            public int getCheckJdoStore() {
197:                return checkJdoStore;
198:            }
199:
200:            public int getCheckJdoClear() {
201:                return checkJdoClear;
202:            }
203:
204:            public int getCheckJdoDelete() {
205:                return checkJdoDelete;
206:            }
207:
208:            public Locale getLocale() {
209:                return locale;
210:            }
211:
212:            public void setLocale(Locale l) {
213:                this .locale = l;
214:            }
215:
216:            public String getNonullField() {
217:                return nonullField;
218:            }
219:
220:            public void setNonullField(String nonullField) {
221:                this .nonullField = nonullField;
222:            }
223:
224:            public String getUndeclaredField() {
225:                return undeclaredField;
226:            }
227:
228:            public void setUndeclaredField(String undeclaredField) {
229:                this.undeclaredField = undeclaredField;
230:            }
231:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.