Alex Karasulu wrote:
Hi,

It's me again got a couple more questions:

1). I peeked at the way an Integer is serialized in the TupleBinding 
class.  It appears as though the native sorting order of integer keys 
and values will be the natural integer order.  Just double checking
so I don't need to write a comparator for an Integer key or value right?
  
That's right -- no comparators are needed. From http://www.sleepycat.com/docs/ref/bdb_tuple/intro.html:
Tuples are useful as keys because they have a meaningful sort order, while serialized objects do not. This is because the binary data for a tuple is written in such a way that its raw byte ordering provides a useful sort order. For example, strings in tuples are written with a null terminator rather than with a leading length.
2). Also is there a way to not have to wrap primitive types using the
binding API's - basically is there some means to just setData on an entry
but get the binding to produce a byte[] from a int and not an Integer
  
Mark is the expert here, but you can use the tuple classes to create your own custom binding. Or you could use com.sleepycat.bind.tuple.TupleInput, TupleOutput  to read and write primitive types to a byte buffer. See http://www.sleepycat.com/jedocs/java/index.html.

The general notion is that you create a TupleBinding, using the TupleInput/Output to get you from your object to the byte array, but you could also use them independently.  The Getting Started Guide has some examples: http://www.sleepycat.com/jedocs/GettingStartedGuide/bindAPI.html#customTuple


Regards,

Linda
Sleepycat Software