KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > versant > core > jdo > InitState


1
2 /*
3  * Copyright (c) 1998 - 2005 Versant Corporation
4  * All rights reserved. This program and the accompanying materials
5  * are made available under the terms of the Eclipse Public License v1.0
6  * which accompanies this distribution, and is available at
7  * http://www.eclipse.org/legal/epl-v10.html
8  *
9  * Contributors:
10  * Versant Corporation - initial API and implementation
11  */

12 package com.versant.core.jdo;
13
14 import com.versant.core.common.OID;
15 import com.versant.core.common.State;
16 import com.versant.core.metadata.ClassMetaData;
17 import com.versant.core.metadata.FetchGroup;
18 import com.versant.core.metadata.ModelMetaData;
19 import com.versant.core.server.OIDGraph;
20
21 import javax.jdo.spi.PersistenceCapable;
22 import java.io.IOException JavaDoc;
23 import java.io.ObjectInput JavaDoc;
24 import java.io.ObjectOutput JavaDoc;
25 import java.util.Date JavaDoc;
26
27 import com.versant.core.common.BindingSupportImpl;
28 import com.versant.core.common.PersistenceContext;
29 import com.versant.core.util.IntArray;
30 import com.versant.core.util.OIDObjectOutput;
31 import com.versant.core.util.OIDObjectInput;
32
33 /**
34  * This is a nonmutable state that is used to obtain the default values for fields.
35  */

36 public class InitState extends State {
37
38     public boolean isCacheble() {
39         return false;
40     }
41
42     public boolean isFieldNullorZero(int stateFieldNo) {
43         return false; //To change body of implemented methods use File | Settings | File Templates.
44
}
45
46     public boolean checkKeyFields(OID oid) {
47         throw createBadMethodException();
48     }
49
50     public void setInternalBooleanFieldAbs(int field, boolean newValue) {
51         throw createBadMethodException();
52     }
53
54     public void findDirectEdges(OIDGraph graph,
55             IntArray edges) {
56         throw createBadMethodException();
57     }
58
59     public void setInternalIntField(int field, int newValue) {
60         throw createBadMethodException();
61     }
62
63     public int getClassIndex() {
64         throw createBadMethodException();
65     }
66
67     public void makeDirtyAbs(int fieldNo) {
68         throw createBadMethodException();
69     }
70
71     public void setDoubleField(int stateFieldNo, double newValue) {
72         throw createBadMethodException();
73     }
74
75     public int replaceSCOFields(PersistenceCapable owner,
76             VersantPersistenceManagerImp sm, int[] absFieldNos) {
77         throw createBadMethodException();
78     }
79
80     public void setCharField(int stateFieldNo, char newValue) {
81         throw createBadMethodException();
82     }
83
84     public void copyOptimisticLockingField(State state) {
85         throw createBadMethodException();
86     }
87
88     public void clear() {
89     }
90
91     public void setStringField(int stateFieldNo, String JavaDoc newValue) {
92         throw createBadMethodException();
93     }
94
95     public void setBooleanFieldAbs(int absFieldNo, boolean newValue) {
96         throw createBadMethodException();
97     }
98
99     public void updateNonFilled(State state) {
100         throw createBadMethodException();
101     }
102
103     public boolean isHollow() {
104         throw createBadMethodException();
105     }
106
107     public void setInternalDoubleFieldAbs(int field, double newValue) {
108         throw createBadMethodException();
109     }
110
111     public byte getByteField(int stateFieldNo) {
112         return 0;
113     }
114
115     public void clearCollectionFields() {
116         throw createBadMethodException();
117     }
118
119     public void setInternalShortFieldAbs(int field, short newValue) {
120         throw createBadMethodException();
121     }
122
123     public void clearDirtyFields() {
124         throw createBadMethodException();
125     }
126
127     public int compareToPass1(State state) {
128         throw createBadMethodException();
129     }
130
131     public boolean fillToStoreState(State stateToStore, PersistenceContext sm, VersantStateManager pcStateMan) {
132         throw createBadMethodException();
133     }
134
135     public void updateAutoSetFieldsCreated(Date JavaDoc now) {
136         throw createBadMethodException();
137     }
138
139     public boolean getBooleanFieldAbs(int absFieldNo) {
140         return false;
141     }
142
143     public void copyFieldsForOptimisticLocking(State state,
144             VersantPersistenceManagerImp sm) {
145         throw createBadMethodException();
146     }
147
148     public void setByteFieldAbs(int absFieldNo, byte newValue) {
149         throw createBadMethodException();
150     }
151
152     public char getCharField(int stateFieldNo) {
153         return 0;
154     }
155
156     public void setInternalBooleanField(int field, boolean newValue) {
157         throw createBadMethodException();
158     }
159
160     public boolean containFieldsAbs(int[] absFieldNos) {
161         throw createBadMethodException();
162     }
163
164     public int getPass1FieldRefFieldNosWithNewOids(int[] stateFieldNoBuf) {
165         throw createBadMethodException();
166     }
167
168     public void setBooleanField(int stateFieldNo, boolean newValue) {
169         throw createBadMethodException();
170     }
171
172     public void setStringFieldAbs(int absFieldNo, String JavaDoc newValue) {
173         throw createBadMethodException();
174     }
175
176     public long getLongFieldAbs(int absFieldNo) {
177         return 0;
178     }
179
180     public void setCharFieldAbs(int absFieldNo, char newValue) {
181         throw createBadMethodException();
182     }
183
184     public void setInternalByteFieldAbs(int field, byte newValue) {
185         throw createBadMethodException();
186     }
187
188     public void makeClean() {
189         throw createBadMethodException();
190     }
191
192     public boolean containsFieldAbs(int absFieldNo) {
193         return true;
194     }
195
196     public void setClassMetaData(ClassMetaData cmd) {
197         throw createBadMethodException();
198     }
199
200     public void clearNonFilled(State state) {
201         throw createBadMethodException();
202     }
203
204     public void setInternalFloatFieldAbs(int field, float newValue) {
205         throw createBadMethodException();
206     }
207
208     public void setInternalObjectFieldAbs(int field, Object JavaDoc newValue) {
209         throw createBadMethodException();
210     }
211
212     public void clearNonAutoSetFields() {
213         throw createBadMethodException();
214     }
215
216     public String JavaDoc getStringFieldAbs(int absFieldNo) {
217         return null;
218     }
219
220     public void setIntFieldAbs(int absFieldNo, int newValue) {
221         throw createBadMethodException();
222     }
223
224     public int getFieldNos(int[] buf) {
225         throw createBadMethodException();
226     }
227
228     public void updateAutoSetFieldsModified(Date JavaDoc now, State oldState) {
229         throw createBadMethodException();
230     }
231
232     public void setInternalStringFieldAbs(int field, String JavaDoc newValue) {
233         throw createBadMethodException();
234     }
235
236     public double getDoubleFieldAbs(int absFieldNo) {
237         return 0;
238     }
239
240     public void setDoubleFieldAbs(int absFieldNo, double newValue) {
241         throw createBadMethodException();
242     }
243
244     public void clearSCOFields() {
245         throw createBadMethodException();
246     }
247
248     public boolean hasSameFields(State state) {
249         throw createBadMethodException();
250     }
251
252     public short getShortFieldAbs(int absFieldNo) {
253         return 0;
254     }
255
256     public void setShortField(int stateFieldNo, short newValue) {
257         throw createBadMethodException();
258     }
259
260     public String JavaDoc getStringField(int stateFieldNo) {
261         return null;
262     }
263
264     public void copyKeyFields(OID oid) {
265         throw createBadMethodException();
266     }
267
268     public byte getByteFieldAbs(int absFieldNo) {
269         return 0;
270     }
271
272     public void setFloatFieldAbs(int absFieldNo, float newValue) {
273         throw createBadMethodException();
274     }
275
276     public void setInternalShortField(int field, short newValue) {
277         throw createBadMethodException();
278     }
279
280     public boolean containsValidAppIdFields() {
281         throw createBadMethodException();
282     }
283
284     public void addRefs(VersantPersistenceManagerImp sm, PCStateMan pcStateMan) {
285     }
286
287     public Object JavaDoc getObjectField(int stateFieldNo, PersistenceCapable owningPC,
288             PersistenceContext sm, OID oid) {
289         return null;
290     }
291
292     public Object JavaDoc getInternalObjectField(int field) {
293         return null;
294     }
295
296     public void copyKeyFieldsUpdate(OID oid) {
297         throw createBadMethodException();
298     }
299
300     public void setInternalCharField(int field, char newValue) {
301         throw createBadMethodException();
302     }
303
304     public void setInternalFloatField(int field, float newValue) {
305         throw createBadMethodException();
306     }
307
308     public void setInternalIntFieldAbs(int field, int newValue) {
309         throw createBadMethodException();
310     }
311
312     public void setInternalCharFieldAbs(int field, char newValue) {
313         throw createBadMethodException();
314     }
315
316     public double getDoubleField(int stateFieldNo) {
317         return 0;
318     }
319
320     public float getFloatFieldAbs(int absFieldNo) {
321         return 0;
322     }
323
324     public int getPass1FieldNos(int[] buf) {
325         throw createBadMethodException();
326     }
327
328     public ClassMetaData getClassMetaData(ModelMetaData jmd) {
329         throw createBadMethodException();
330     }
331
332     public ClassMetaData getClassMetaData() {
333         throw createBadMethodException();
334     }
335
336     public char getCharFieldAbs(int absFieldNo) {
337         return 0;
338     }
339
340     public State getCopy() {
341         throw createBadMethodException();
342     }
343
344     public void setInternalDoubleField(int field, double newValue) {
345         throw createBadMethodException();
346     }
347
348     public void setInternalLongFieldAbs(int field, long newValue) {
349         throw createBadMethodException();
350     }
351
352     public void clearApplicationIdentityFields() {
353         throw createBadMethodException();
354     }
355
356     public boolean isEmpty() {
357         throw createBadMethodException();
358     }
359
360     public float getFloatField(int stateFieldNo) {
361         return 0;
362     }
363
364     public void setInternalLongField(int field, long newValue) {
365         throw createBadMethodException();
366     }
367
368     public void setLongFieldAbs(int absFieldNo, long newValue) {
369         throw createBadMethodException();
370     }
371
372     public void setObjectField(int stateFieldNo, Object JavaDoc newValue) {
373         throw createBadMethodException();
374     }
375
376     public void setInternalStringField(int field, String JavaDoc newValue) {
377         throw createBadMethodException();
378     }
379
380     public boolean containsPass2Fields() {
381         throw createBadMethodException();
382     }
383
384     public boolean isDirty() {
385         throw createBadMethodException();
386     }
387
388     public boolean isDirty(int fieldNo) {
389         throw createBadMethodException();
390     }
391
392     public void retrieve(VersantPersistenceManagerImp sm) {
393         throw createBadMethodException();
394     }
395
396     public void clearTransactionNonPersistentFields() {
397         throw createBadMethodException();
398     }
399
400     public void setObjectFieldAbs(int absFieldNo, Object JavaDoc newValue) {
401         throw createBadMethodException();
402     }
403
404     public void setObjectFieldUnresolved(int field, Object JavaDoc newValue) {
405         throw createBadMethodException();
406     }
407
408     public void setObjectFieldUnresolvedAbs(int field, Object JavaDoc newValue) {
409         throw createBadMethodException();
410     }
411
412     public void setInternalObjectField(int field, Object JavaDoc newValue) {
413         throw createBadMethodException();
414     }
415
416     public void setShortFieldAbs(int absFieldNo, short newValue) {
417         throw createBadMethodException();
418     }
419
420     public boolean containsApplicationIdentityFields() {
421         throw createBadMethodException();
422     }
423
424     public Object JavaDoc getInternalObjectFieldAbs(int field) {
425         return null;
426     }
427
428     public State newInstance() {
429         throw createBadMethodException();
430     }
431
432     public short getShortField(int stateFieldNo) {
433         return 0;
434     }
435
436     public boolean containsFetchGroup(FetchGroup fetchGroup) {
437         throw createBadMethodException();
438     }
439
440     public Object JavaDoc getObjectFieldAbs(int absFieldNo,
441             PersistenceCapable owningPC, PersistenceContext sm,
442             OID oid) {
443         return null;
444     }
445
446     public void setFloatField(int stateFieldNo, float newValue) {
447         throw createBadMethodException();
448     }
449
450     public void updateFrom(State state) {
451         throw createBadMethodException();
452     }
453
454     public int getPass2FieldNos(int[] buf) {
455         throw createBadMethodException();
456     }
457
458     public boolean containsPass1Fields() {
459         throw createBadMethodException();
460     }
461
462     public void setIntField(int stateFieldNo, int newValue) {
463         throw createBadMethodException();
464     }
465
466     public boolean replaceNewObjectOIDs(int[] fieldNos, int fieldNosLength) {
467         throw createBadMethodException();
468     }
469
470     public boolean hasSameNullFields(State state, State mask) {
471         throw createBadMethodException();
472     }
473
474     public void unmanageSCOFields() {
475         throw createBadMethodException();
476     }
477
478     public int getIntField(int stateFieldNo) {
479         return 0;
480     }
481
482     public int getIntFieldAbs(int absFieldNo) {
483         return 0;
484     }
485
486     public void setInternalByteField(int field, byte newValue) {
487         throw createBadMethodException();
488     }
489
490     public String JavaDoc getVersion() {
491         throw createBadMethodException();
492     }
493
494     public long getLongField(int stateFieldNo) {
495         return 0;
496     }
497
498     public long getLongFieldInternal(int stateFieldNo) {
499         return 0;
500     }
501
502     public void copyFields(OID oid) {
503         throw createBadMethodException();
504     }
505
506     public boolean isNull(int stateFieldNo) {
507         throw createBadMethodException();
508     }
509
510     public boolean getBooleanField(int stateFieldNo) {
511         return false;
512     }
513
514     public void setLongField(int stateFieldNo, long newValue) {
515         throw createBadMethodException();
516     }
517
518     public boolean containFields(int[] stateFieldNos) {
519         throw createBadMethodException();
520     }
521
522     public boolean containsField(int stateFieldNo) {
523         return true;
524     }
525
526     public void setByteField(int stateFieldNo, byte newValue) {
527         throw createBadMethodException();
528     }
529
530     public void readExternal(ObjectInput JavaDoc in) throws IOException JavaDoc,
531             ClassNotFoundException JavaDoc {
532         //To change body of implemented methods use Options | File Templates.
533
}
534
535     public void writeExternal(ObjectOutput JavaDoc out) throws IOException JavaDoc {
536         //To change body of implemented methods use Options | File Templates.
537
}
538
539     /**
540      * Add all states referenced by fields in fg to the dcs.
541      */

542     public void addFetchGroupStatesToDCS(FetchGroup fg,
543             DetachStateContainer dcs, VersantPersistenceManagerImp pm,
544             OID oid) {
545         throw createBadMethodException();
546     }
547
548     /**
549      * Is this state field nummber resolved for the Client
550      */

551     public boolean isResolvedForClient(int stateFieldNo) {
552         throw createBadMethodException();
553     }
554
555     /**
556      * The value of the version field on the pc.
557      * This will return null if there are no version fields.
558      */

559     public Object JavaDoc getOptimisticLockingValue() {
560         throw createBadMethodException();
561     }
562
563     private RuntimeException JavaDoc createBadMethodException() {
564         return BindingSupportImpl.getInstance().internal(
565                 "This method should not be called");
566     }
567
568     public void setFilled(int field) {
569         throw createBadMethodException();
570     }
571
572     public void fillForRead(State dest,
573             VersantPersistenceManagerImp sm) {
574         throw createBadMethodException();
575     }
576
577     public void clearFilledFlags() {
578         throw createBadMethodException();
579     }
580
581     public void addOneToManyInverseFieldsForL2Evict(
582             VersantPersistenceManagerImp pm) {
583         throw createBadMethodException();
584     }
585
586     public void writeExternal(OIDObjectOutput os) throws IOException JavaDoc {
587         throw createBadMethodException();
588     }
589
590     public void readExternal(OIDObjectInput is) throws IOException JavaDoc,
591             ClassNotFoundException JavaDoc {
592         throw createBadMethodException();
593     }
594
595 }
596
Popular Tags