I'm trying to use @SecondaryTable, hoping to join from a foreign key on my p

I'm trying to use @SecondaryTable, hoping to join from a foreign key on my primary table to the primary key on the secondary table. However it seems to ignore my referencedColumn annotation and joins to the primary key of my primary table. Is it not possible to use @SecondaryTable with something other than the primary key of the primary table?

DOC_TABLE:
DOC_ID (pk)
TYPE_ID (fk to LOOKUP_ID of LOOKUP table)

LOOKUP_TABLE:
LOOKUP_ID (pk)
DOMAIN_VALUE (field I want to show in my CDT).

CDT mapping:
<xsd:complexType name="TAX_Doc">
<xsd:annotation>
<xsd:appinfo source="appian.jpa">
@Table(name="DOC_TABLE")
@SecondaryTable(name="LOOKUP_TABLE", pkJoinColumns=@PrimaryKeyJoinColumn(name="LOOKUP_ID", referencedColumnName="TYPE_ID"))
</xsd:appinfo>
</xsd:annotation>
<xsd:sequence>
<xsd:element name="id" type="xsd:int">
<xsd:annotation>
<xsd:appinfo source="appian.jpa">
@Column(name="DOC_ID", nullable=false)
...

OriginalPostID-81009

OriginalPostID-81009

  Discussion posts and replies are publicly visible

Parents Reply Children
No Data