Cleaned up some jpa query code.
ADded code to the client that removed the same entity twice.
Authored by: keess 2008-09-30
Parent: [r2100]
Child: [r2102]