There is a solution, but it is part of hibernate NOT the EJB3 specification!
I know your pain about working with hideous legacy databases!
If you include the hibernate-annotations.jar from the jboss lib directory you can use the
following annotation on your accessor method: -
@NotFound(action=NotFoundAction.IGNORE)
Entities with invalid foreign keys will be ignored by the EntityManager.
There is a portability cost, but it might be worth it!!
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4046836#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...