1/*-
2 * See the file LICENSE for redistribution information.
3 *
4 * Copyright (c) 2002,2008 Oracle.  All rights reserved.
5 *
6 * $Id: Enhanced2.java,v 1.1 2008/02/07 17:12:32 mark Exp $
7 */
8
9package com.sleepycat.persist.test;
10
11import com.sleepycat.persist.impl.EnhancedAccessor;
12import com.sleepycat.persist.impl.EntityInput;
13import com.sleepycat.persist.impl.EntityOutput;
14import com.sleepycat.persist.impl.Format;
15import com.sleepycat.persist.model.Persistent;
16
17/**
18 * For running ASMifier -- entity sublcass.
19 */
20@Persistent
21class Enhanced2 extends Enhanced1 {
22
23    static {
24        EnhancedAccessor.registerClass(null, new Enhanced2());
25    }
26
27    public Object bdbNewInstance() {
28        return new Enhanced2();
29    }
30
31    public Object bdbNewArray(int len) {
32        return new Enhanced2[len];
33    }
34
35    public boolean bdbIsPriKeyFieldNullOrZero() {
36        return super.bdbIsPriKeyFieldNullOrZero();
37    }
38
39    public void bdbWritePriKeyField(EntityOutput output, Format format) {
40        super.bdbWritePriKeyField(output, format);
41    }
42
43    public void bdbReadPriKeyField(EntityInput input, Format format) {
44        super.bdbReadPriKeyField(input, format);
45    }
46
47    public void bdbWriteSecKeyFields(EntityOutput output) {
48        super.bdbWriteSecKeyFields(output);
49    }
50
51    public void bdbReadSecKeyFields(EntityInput input,
52                                    int startField,
53                                    int endField,
54                                    int superLevel) {
55        if (superLevel != 0) {
56            super.bdbReadSecKeyFields
57                (input, startField, endField, superLevel - 1);
58        }
59    }
60
61    public void bdbWriteNonKeyFields(EntityOutput output) {
62        super.bdbWriteNonKeyFields(output);
63    }
64
65    public void bdbReadNonKeyFields(EntityInput input,
66                                    int startField,
67                                    int endField,
68                                    int superLevel) {
69        if (superLevel != 0) {
70            super.bdbReadNonKeyFields
71                (input, startField, endField, superLevel - 1);
72        }
73    }
74
75    public boolean bdbNullifyKeyField(Object o,
76                                      int field,
77                                      int superLevel,
78                                      boolean isSecField,
79                                      Object keyElement) {
80        if (superLevel > 0) {
81            return super.bdbNullifyKeyField
82                (o, field, superLevel - 1, isSecField, keyElement);
83        } else {
84            return false;
85        }
86    }
87
88    public Object bdbGetField(Object o,
89                              int field,
90                              int superLevel,
91                              boolean isSecField) {
92        if (superLevel > 0) {
93            return super.bdbGetField
94                (o, field, superLevel - 1, isSecField);
95        } else {
96            return null;
97        }
98    }
99
100    public void bdbSetField(Object o,
101                            int field,
102                            int superLevel,
103                            boolean isSecField,
104                            Object value) {
105        if (superLevel > 0) {
106            super.bdbSetField
107                (o, field, superLevel - 1, isSecField, value);
108        }
109    }
110}
111