Reputation: 33
I have a database that the relation beatween the table is not specified ,I mean foreign keys are not mentioned clearly,I have understand them by observing the database when Ihave filled it and by doing some request SQL select. My question can I do mapping object/relational using JPA/Hibernate ? mapping do not require that the database have foreignkey in the SQL script??
Upvotes: 0
Views: 50
Reputation: 120168
It should not get in the way. But the database should have the foreign keys added, which you can do without destroying the data via altering the tables. Having the foreign keys gives you another layer of protection in that if you set up your hibernate relationships incorrectly, the database itself will prevent modifications that don't match its schema.
Upvotes: 1