示例#1
0
 /**
  * Custom serialization routine used during serialization of a Session/PersistenceContext for
  * increased performance.
  *
  * @param oos The stream to which we should write the serial data.
  * @throws IOException If a stream error occurs
  */
 public void serialize(ObjectOutputStream oos) throws IOException {
   oos.writeObject(entityName);
   oos.writeObject(id);
   oos.writeObject(entityMode.toString());
   oos.writeObject(tenantId);
   oos.writeObject(status.name());
   oos.writeObject((previousStatus == null ? "" : previousStatus.name()));
   // todo : potentially look at optimizing these two arrays
   oos.writeObject(loadedState);
   oos.writeObject(deletedState);
   oos.writeObject(version);
   oos.writeObject(lockMode.toString());
   oos.writeBoolean(existsInDatabase);
   oos.writeBoolean(isBeingReplicated);
   oos.writeBoolean(loadedWithLazyPropertiesUnfetched);
 }
 /**
  * Custom serialization routine used during serialization of a Session/PersistenceContext for
  * increased performance.
  *
  * @param oos The stream to which we should write the serial data.
  * @throws java.io.IOException
  */
 void serialize(ObjectOutputStream oos) throws IOException {
   oos.writeObject(role);
   oos.writeObject(key);
   oos.writeObject(keyType);
   oos.writeObject(entityMode.toString());
 }