anchor.diff:          {
   <% if is_primitive && attr_type == :integer %>          output.writeInt( get<%= name %>() );
   <% elsif attr_type == :integer %>          output.writeInt( (get<%= name %>() == null) ? 0 : get<%= name %>() );
  +<% elsif attr_type == :i_enum %>          output.writeByte( (get<%= name %>() == null) ? (byte)0 : (byte)get<%= name %>().getValue() );
   <% elsif is_primitive && attr_type == :boolean %>          output.writeBoolean( get<%= name %>() );
   <% elsif attr_type == :boolean %>          output.writeBoolean( (get<%= name %>() == null) ? false : get<%= name %>() );
  -<% elsif attr_type == :string %>          output.writeUTF( (get<%= name %>() == null) ? "\0" : get<%= name %>() );
  +<% elsif attr_type == :string || attr_type == :s_enum %>          output.writeUTF( (get<%= name %>() == null) ? "\0" : get<%= name %>() );
   <% elsif attr_type == :datetime %>          output.writeLong( (get<%= name %>() == null) ? Long.MAX_VALUE : get<%= name %>().getTime() );
   <% else %>          throw new IllegalStateException( "Unknown attribute type transmitted <%= attr_type %>" );<% end %>
           }
  
positive.code:       {
          {
  <% if attr_type == :integer %>          final Object value = input.readInt();
  <% elsif attr_type == :boolean %>          final Object value = input.readBoolean();
  <% elsif attr_type == :string %>          final String string = input.readUTF();
            final Object value = "\0".equals( string ) ? null : string;
  <% elsif attr_type == :datetime %>          final long time = input.readLong();
            final Object value = ( Long.MAX_VALUE == time ) ? null : new Timestamp( time );
  <% else %>          throw new IllegalStateException( "Unknown attribute type transmitted <%= attr_type %>" );<% end %>
            data.put( COLUMN_<%= uppercase_constantize(name) %>, value );
          }
  
negative.code: <% end
  end %>
           setLinked( false );
  <% object_type.attributes.select {|a| a.reference? && !a.iris.runtime_managed?}.each do |attribute|
       name = attribute.java.field_name
       type = j_attribute_type(attribute)
  %>
  