2 Replies Latest reply on Jul 14, 2005 11:18 PM by Emmanuel Bernard

    How can I use a field named "id"

    Joachim Van der Auwera Expert

      I am trying to convert my application to EJB3, but some of my beans/pojos have a field named "Id", which contains a value whch is not the primary key (there is another field for that).

      However, when I create a query like

      SELECT o FROM TestObject o where o.id = :id

      it allways tries to select based on the primary key, not the "id" field.
      I know that "id" (and "class" and "size"à are special properties in hibernate, but how can I circumvent this hibernate specific behaviour. I found no references to these special properties in the ejb spec.

      Thanks for the help,
      Joachim