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
Discussion posts and replies are publicly visible
What do you want to achieve? If this table is represented as a record, you could have a custom record field.
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.
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
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
Please refer below urls,
docs.appian.com/.../Supported_XSD_Elements_and_JPA_Annotations.html