Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] Detecting inconsistent foreign references

Hello,

I'd like to know if there's a way to detect/react on a data inconsistency in eclipselink.

Example:
1. Imagine an entity A which has a ManyToOne mapping to entity B.
2. Imagine a database record for an entity A which contains an invalid foreign key (there is no primary key for this foreign key in the table of entity B) 3. The corresponding entity A of such a database record is fetched (using EntityManager.find()).
4. The reference of the mapping to B is null.

Unfortunately, it's also null when the underlying foreign key is null.
As a result you cannot distinguish between a "real" null foreign key, and an invalid/inconsistent one.

Is it possible to detect such an inconsistency?

Best regards,
Patric



Back to the top