CDT persistence - JoinColumn with referencedColumnName

Hi,

I've created some CDTs with annotations for database table creation and persistence and run into an issue with naming a column in a join table.

Here is a code snippet from my CDT definition:

      <xsd:element maxOccurs="unbounded" minOccurs="0" name="roleIds" type="xsd:int">
        <xsd:annotation>
          <xsd:appinfo source="appian.jpa">
            @OneToMany(cascade=CascadeType.ALL, indexed=false)
            @JoinTable(name="FSA_REQUESTED_SYSTEM_ROLE_JOIN")
            @JoinColumn(name="REQUESTED_SYSTEM_ID", referencedColumnName="ROLE_ID")
          </xsd:appinfo>
        </xsd:annotation>
      </xsd:element>

The issue is that the join table that's been created does not contain a ROLE_ID column, instead it has been called "elt", which is not a particularly helpful name.

Does anyone know how to fix this?

  Discussion posts and replies are publicly visible

Parents Reply
  • 0
    Appian Employee
    in reply to nauman

    This is a pretty old post - if you're having an issue setting up your data structure, I'd suggest creating a new post with context for what you're trying to do and what isn't working.

    Also just a quick note - usually if you have a flat data structure you don't even use annotations in your CDT. Instead, I'd recommend setting up the table structure that you want directly in the database and then create your CDTs from the already created table.

Children
No Data