Beispiel #1
0
 @Override
 void writeObject(Object o, EntityOutput output, boolean rawAccess) {
   if (rawAccess) {
     proxyFormat.writeObject(o, output, true);
   } else {
     PersistentProxy proxy = (PersistentProxy) proxyFormat.newInstance(null, false);
     proxy.initializeProxy(o);
     proxyFormat.writeObject(proxy, output, false);
   }
 }
 static void copyElements(RecordInput input, Format format, Format keyFormat, Set results) {
   /*
    * This could be optimized by traversing the byte format of the
    * collection's elements array.
    */
   RawObject collection = (RawObject) format.newInstance(input, true);
   collection = (RawObject) format.readObject(collection, input, true);
   Object[] elements = getElements(collection);
   if (elements != null) {
     for (Object elem : elements) {
       RecordOutput output = new RecordOutput(input.getCatalog(), true);
       output.writeKeyObject(elem, keyFormat);
       DatabaseEntry entry = new DatabaseEntry();
       TupleBase.outputToEntry(output, entry);
       results.add(entry);
     }
   }
 }