Пример #1
0
 @Override
 public boolean visitRelationshipCommand(Command.RelationshipCommand command) throws IOException {
   RelationshipRecord record = command.getRecord();
   byte flags =
       bitFlags(
           bitFlag(record.inUse(), Record.IN_USE.byteValue()),
           bitFlag(record.isCreated(), Record.CREATED_IN_TX));
   channel.put(NeoCommandType.REL_COMMAND);
   channel.putLong(record.getId());
   channel.put(flags);
   if (record.inUse()) {
     channel
         .putLong(record.getFirstNode())
         .putLong(record.getSecondNode())
         .putInt(record.getType())
         .putLong(record.getFirstPrevRel())
         .putLong(record.getFirstNextRel())
         .putLong(record.getSecondPrevRel())
         .putLong(record.getSecondNextRel())
         .putLong(record.getNextProp())
         .put(
             (byte)
                 ((record.isFirstInFirstChain() ? 1 : 0)
                     | (record.isFirstInSecondChain() ? 2 : 0)));
   } else {
     channel.putInt(record.getType());
   }
   return false;
 }