What exactally is wrong with the query?
As part of the creation of the CustomerEJB it does the following:
CustomerStatus status = CustomerStatusHome.findByPrimaryKey(1);
This seems to be where the problem occurs. It looks up that CustomerStatus entity, and then all the Customers with that status.
It is the second part I wish to stop.
Relationships user referencial integerity, so the container need to verify that there are no entities assigned to this relationship in the database. There is no way to disable it, as without the check you can end up with an inconsistent database state.