|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Enhanced
Interface implemented by a persistent class via bytecode enhancement.
See Accessor
for method documentation. EnhancedAccessor
implements Accessor and forwards all calls to methods in the Enhanced
class.
Each class that implements this interface (including its subclasses and
superclasses except for Object) must also implement a static block that
registers a prototype instance by calling
EnhancedAccessor.registerPrototype. Other instances are created from the
protype instance using bdbNewInstance()
.
static { EnhancedAccessor.registerPrototype(new Xxx()); }
An example of the generated code for reading and writing fields is shown below.
private int f1; private String f2; private MyClass f3; public void bdbWriteNonKeyFields(EntityOutput output) { super.bdbWriteNonKeyFields(output); output.writeInt(f1); output.writeObject(f2, null); output.writeObject(f3, null); } public void bdbReadNonKeyFields(EntityInput input, int startField, int endField, int superLevel) { if (superLevel != 0) { super.bdbReadNonKeyFields(input, startField, endField, superLevel - 1); } if (superLevel <= 0) { switch (startField) { case 0: f1 = input.readInt(); if (endField == 0) break; case 1: f2 = (String) input.readObject(); if (endField == 1) break; case 2: f3 = (MyClass) input.readObject(); } } }
Method Summary | |
---|---|
Object |
bdbGetField(Object o,
int field,
int superLevel,
boolean isSecField)
|
boolean |
bdbIsPriKeyFieldNullOrZero()
Calls the super class method if this class does not contain the primary key field. |
Object |
bdbNewArray(int len)
|
Object |
bdbNewInstance()
|
void |
bdbReadCompositeKeyFields(EntityInput input,
Format[] formats)
|
void |
bdbReadNonKeyFields(EntityInput input,
int startField,
int endField,
int superLevel)
|
void |
bdbReadPriKeyField(EntityInput input,
Format format)
Calls the super class method if this class does not contain the primary key field. |
void |
bdbReadSecKeyFields(EntityInput input,
int startField,
int endField,
int superLevel)
|
void |
bdbSetField(Object o,
int field,
int superLevel,
boolean isSecField,
Object value)
|
void |
bdbSetPriField(Object o,
Object value)
|
void |
bdbWriteCompositeKeyFields(EntityOutput output,
Format[] formats)
|
void |
bdbWriteNonKeyFields(EntityOutput output)
|
void |
bdbWritePriKeyField(EntityOutput output,
Format format)
Calls the super class method if this class does not contain the primary key field. |
void |
bdbWriteSecKeyFields(EntityOutput output)
|
Method Detail |
---|
Object bdbNewInstance()
Accessor.newInstance()
Object bdbNewArray(int len)
Accessor.newArray(int)
boolean bdbIsPriKeyFieldNullOrZero()
Accessor.isPriKeyFieldNullOrZero(java.lang.Object)
void bdbWritePriKeyField(EntityOutput output, Format format) throws RefreshException
RefreshException
Accessor.writePriKeyField(java.lang.Object, com.sleepycat.persist.impl.EntityOutput)
void bdbReadPriKeyField(EntityInput input, Format format) throws RefreshException
RefreshException
Accessor.readPriKeyField(java.lang.Object, com.sleepycat.persist.impl.EntityInput)
void bdbWriteSecKeyFields(EntityOutput output) throws RefreshException
RefreshException
Accessor.writeSecKeyFields(java.lang.Object, com.sleepycat.persist.impl.EntityOutput)
void bdbReadSecKeyFields(EntityInput input, int startField, int endField, int superLevel) throws RefreshException
RefreshException
Accessor.readSecKeyFields(java.lang.Object, com.sleepycat.persist.impl.EntityInput, int, int, int)
void bdbWriteNonKeyFields(EntityOutput output) throws RefreshException
RefreshException
Accessor.writeNonKeyFields(java.lang.Object, com.sleepycat.persist.impl.EntityOutput)
void bdbReadNonKeyFields(EntityInput input, int startField, int endField, int superLevel) throws RefreshException
RefreshException
Accessor.readNonKeyFields(java.lang.Object, com.sleepycat.persist.impl.EntityInput, int, int, int)
void bdbWriteCompositeKeyFields(EntityOutput output, Format[] formats) throws RefreshException
RefreshException
Accessor.writeCompositeKeyFields(java.lang.Object, com.sleepycat.persist.impl.EntityOutput)
void bdbReadCompositeKeyFields(EntityInput input, Format[] formats) throws RefreshException
RefreshException
Accessor.readCompositeKeyFields(java.lang.Object, com.sleepycat.persist.impl.EntityInput)
Object bdbGetField(Object o, int field, int superLevel, boolean isSecField)
Accessor.getField(java.lang.Object, int, int, boolean)
void bdbSetField(Object o, int field, int superLevel, boolean isSecField, Object value)
Accessor.setField(java.lang.Object, int, int, boolean, java.lang.Object)
void bdbSetPriField(Object o, Object value)
Accessor.setPriField(java.lang.Object, java.lang.Object)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |