Quote:
Hibernate is not raising an exception when I insert a record which has a foreign key that references a non-existing record.
that's obviously impossible, how could it store something violating the database constraints.
- did you disable database contraints (or run MySQL with MyISAM which doesn't support them)
- you're not mapping objects on the relations, but mapping primitives representing foreign keys
Quote:
Can you give me some tips as to how to do it? I looked in the documentation but I could not find anything.
because it's trivial and automatic, but still Hibernate docs take the assumption people know how to work with databases.
You should first understand how to map objects and relations, I suspect that's the issue.. could you show a very simple relation?