3 Replies Latest reply on Jun 25, 2002 1:27 PM by Dain Sundstrom

    Strange queries in Many to One relationship

    Dave Brown Newbie


      I have a problem with the queries being generated against my database (PostgreSQL) using JBoss-3.0.0. The application takes advantage of the new CMP code.

      From the logs it can be seen when I create a new customer object the system gets the appropriate status object and then for some reason selects all the Customers with that status.

      Anyone got any idea why this is happening and how I can avoid it?


      CustomerEJB (Many) -> CustomerStatusEJB (One)

      2002-06-23 10:06:41,115 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.CustomerStatusEJB] Executing SQL: SELECT status FROM customerstatusejb WHERE (id=?)
      2002-06-23 10:06:41,119 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadRelationCommand.CustomerStatusEJB] Executing SQL: SELECT id FROM customerejb WHERE (status=?)

      <!-- Customer - CustomerStatus -->