Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
+1
person also asked this
people also asked this
Replies
5 replies
Subscribers
8 subscribers
Views
11892 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
Integrations
I'm trying to use @SecondaryTable, hoping to join from a foreign key on my p
peterh
over 11 years ago
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
0
peterh
over 11 years ago
... @Id
@GeneratedValue
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element name="domainValueTxt" type="xsd:int">
<xsd:annotation>
<xsd:appinfo source="appian.jpa">
@Column(table="LOOKUP_TABLE", name="DOMAIN_VALUE", insertable="false", updatable="false")
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Reply
0
peterh
over 11 years ago
... @Id
@GeneratedValue
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element name="domainValueTxt" type="xsd:int">
<xsd:annotation>
<xsd:appinfo source="appian.jpa">
@Column(table="LOOKUP_TABLE", name="DOMAIN_VALUE", insertable="false", updatable="false")
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Children
No Data