Ids are generated instead of actual entity relationships when there is no visibility to the TableClass from the jdbc connection.. creating public synonyms (or equivalent) to these tables might help. This kind of behaviour can be observed with reverse engineering even when tables are chosen selectively. entity realationships to unselected tables would typically be generated in the fashion that you are currently experiencing
for e.g. for there are two tables Person and Address and a link from Address to Person..
selecting both Person and Address would generate a proper entity relatioship in Address like
private Person person;
On the other hand, selecting just Address will simply create a mapping to the raw type as the Person entity is not generated by JPA Tools
private BigDecimal personId;
which is what seems to be happening in your case
`