I created two CMP beans which have a relationship between them realized via a relation table. The database tables have existed before and the beans only need to be read only.
My problem is:
The relation table sometimes contains PK-references that do not exist in the entity tables, so there is no strict referencial integrety.
When JBoss tries to fetch the beans needed within a CMR relation, it throws an Exception whenever it finds a PK reference inside the relation table which it cannot find in the respective entity table.
For my context, I need to be able to configure JBoss to silently ignore these dead PK-links. Within SQL this can be done with right/left joins.
Can anyone give me some advise here?
Is it possible to configure JBoss to not assume referencial integrity within foreign key mappings?
Preloading relationship on-find might help you. You would load not just a key value from the relation table but join the related table and preload some fields.
You should configure read-ahead per relationship role in jbosscmp-jdbc.xml with on-find.