I\'ve got the following schema in DB (simplified)
MainTable( ID primary key SOMEFIELD CODE_FK1 -- references OtherTable1 CODE (without declared forei
You can use the @SecondaryTable annotation. See this example:
https://github.com/hibernate/hibernate-orm/blob/823a5c1ede1869fd97471e3b8ebe7ec4ac8068e4/hibernate-core/src/test/java/org/hibernate/test/annotations/join/Dog.java#L20-L24