However, I get the following exception message when I do this since SUBSTR(PERSON_TYPE,1,5) isn't really a column. If I put PERSON_TYPE, everything works fine but it's incorrect business logic.
When the source entity class uses a composite primary key, a @JoinColumn must be specified for each join column using the @JoinColumns. Both the name and the referenceColumnName elements must be specified in each such @JoinColumn.
I understand that this isn't exactly how most composite key relationship are modeled but I'm working with a legacy system. Any ideas for a workaround? I really don't want to use a native query.