Will my code work if I apply one-to-many relation in hibernate- only to entities side in Java and not to DB side (there will not be foreign key between tables and I don't want to modify tables) ?
Question edited below.
Here are my tables - One employee has many certificates
Emp table -->
id (Primary key)
first_name
last_name
salary
emp_id
Certificates Table -->
id (primary key)
certificate_name
cert_id
Here , these tables data are related with emp_id
and cert_id
.(There is no relation in tables for this. But looking at data in existing system they are related)
As it is an existing DB , I don't want to change tables and add foreign key relation in DB. And I want to add relation from hibernate side only. Is it possible. ?