Skip to main content
July 22, 2022
Question

CDT with extra column

  • July 22, 2022
  • 5 replies
  • 0 views

Hi everyone,

CDT with 6 columns and database with 5 columns, Can we map that CDT to database table without adding 6th column in database?

Thank you all in advance!

Regards,

Kiran Sajjan

5 replies

stefanhelzle0001
Brainy
July 22, 2022

What do you want to achieve? If this table is represented as a record, you could have a custom record field.

July 22, 2022

Please share the Usecase why you are looking for this. I think, while publish the Datastore, it will throw an error and if you click on automatic option then it will create a field in DB as well. 

paragr3956
July 22, 2022

Hi Kiran,

You can follow the below example to add transient columns to CDT without having them added to the database.

<xsd:element name="dummy" nillable="true" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="appian.jpa">@Transient</xsd:appinfo>
</xsd:annotation>
</xsd:element>

Note: While you fetch data from database using query entity, it will throw error. The workaround is to use selection parameter of a!query.

Below link explains how to retrieve data if a transient column is present.

https://community.appian.com/support/w/kb/659/kb-1404-queryentity-fails-when-an-xsd-has-a-field-marked-as-transient

harshitb6843
July 22, 2022

Yes. It is possible
If you add the @Transient annotation, you'll be able to achieve it. 
See the sample below. 

Find more of such annotations here - docs.appian.com/.../Supported_XSD_Elements_and_JPA_Annotations.html