com.sleepycat.persist.impl
Class EntityOutput

java.lang.Object
  extended by java.io.OutputStream
      extended by com.sleepycat.util.FastOutputStream
          extended by com.sleepycat.bind.tuple.TupleOutput
              extended by com.sleepycat.persist.impl.EntityOutput
All Implemented Interfaces:
Closeable, Flushable

public class EntityOutput
extends TupleOutput

Used for writing object fields.

Although this class extends TupleOutput, not all TupleOutput methods should be called. See Format for which methods should be called. In particular, Strings should be passed to writeObject(java.lang.Object, com.sleepycat.persist.impl.Format) in this class.

Author:
Mark Hayes

Field Summary
(package private) static int PRI_KEY_VISITED_OFFSET
           
 
Fields inherited from class com.sleepycat.util.FastOutputStream
DEFAULT_BUMP_SIZE, DEFAULT_INIT_SIZE
 
Constructor Summary
EntityOutput(Catalog catalog, boolean rawAccess)
          Creates a new output with an empty/null VisitedObjects set.
 
Method Summary
 void registerPriKeyObject(Object o)
          Called via Accessor.writeSecKeyFields for a primary key field with a reference type.
 void writeKeyObject(Object o, Format fieldFormat)
          Called for a primary key field or composite key field with a reference type.
 void writeObject(Object o, Format fieldFormat)
          Called via Accessor to write all fields with reference types, except for the primary key field and composite key fields (see writeKeyObject below).
 
Methods inherited from class com.sleepycat.bind.tuple.TupleOutput
writeBoolean, writeByte, writeBytes, writeBytes, writeChar, writeChars, writeChars, writeDouble, writeFloat, writeInt, writeLong, writePackedInt, writeShort, writeSortedDouble, writeSortedFloat, writeString, writeString, writeUnsignedByte, writeUnsignedInt, writeUnsignedShort
 
Methods inherited from class com.sleepycat.util.FastOutputStream
addSize, getBufferBytes, getBufferLength, getBufferOffset, makeSpace, reset, size, toByteArray, toString, toString, write, write, write, writeFast, writeFast, writeFast, writeTo
 
Methods inherited from class java.io.OutputStream
close, flush
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PRI_KEY_VISITED_OFFSET

static final int PRI_KEY_VISITED_OFFSET
See Also:
Constant Field Values
Constructor Detail

EntityOutput

EntityOutput(Catalog catalog,
             boolean rawAccess)
Creates a new output with an empty/null VisitedObjects set.

Method Detail

writeObject

public void writeObject(Object o,
                        Format fieldFormat)
Called via Accessor to write all fields with reference types, except for the primary key field and composite key fields (see writeKeyObject below).


writeKeyObject

public void writeKeyObject(Object o,
                           Format fieldFormat)
Called for a primary key field or composite key field with a reference type.


registerPriKeyObject

public void registerPriKeyObject(Object o)
Called via Accessor.writeSecKeyFields for a primary key field with a reference type. This method must be called before writing any other fields.



Copyright 2004-2006 Sleepycat, Inc. All Rights Reserved.