anchor.diff:  %>
       query.setParameter( <%= index + 1 %>, <%= param_value %> );
   <%  end
  -   end %>
  +   end -%>
   <% if query.jpa.offset -%>
       query.setFirstResult( offset );
  -<% end %>
  +<% end -%>
   <% if query.jpa.limit -%>
       query.setMaxResults( limit );
  -<% end %>
  -<% if query.query_type == :select %>
  -<% if query.multiplicity == :many %>
  +<% end -%>
  +<% if query.query_type == :select -%>
  +<% if query.multiplicity == :many -%>
       return query.getResultList();
  -<% elsif query.multiplicity == :one %>
  +<% elsif query.multiplicity == :one -%>
       return query.getSingleResult();
  -<% else %>
  +<% else -%>
       query.setMaxResults( 1 );
       final java.util.List<<%= query_component_result_type(query) %>> resultList = query.getResultList();
       if ( resultList.size() > 0 )
  
positive.code:       return null;
      }
  <% end
     else %>
      return query.executeUpdate();
  <% end %>
    }
  <% end %>
  
  <% if dao.repository? %>
  <% if dao.entity.jpa.detachable? %>
    @java.lang.Override
    public void detach( final <%= dao.entity.jpa.qualified_name %> entity )
    {
  
negative.code:     query.parameters.each do |p|
  %>    query.setParameter( <%= "\"#{p.name}\"" %>, <%= p.name %> );
  <%  end
     else -%>
  <%  query.parameters.each_with_index do |p, index|
      param_suffix = nil
      if p.reference?
  