Team, I have a database view already created. I am now trying to crea

Team,

I have a database view already created. I am now trying to create a data type & data store in appian designer so that i can query the database using a!queryentity().

But it doesn't allow me stating that a_id is missing as it is the primary key. How i need to add this in the XSD file so that no new tables will be created?

OriginalPostID-162993

OriginalPostID-162993

  Discussion posts and replies are publicly visible

Parents
  • @manikandang You need to do two things here:
    1. Provide the name of the database view to the 'name' attribute of @Table annotation.
    2. Provide the name of the column (which ever you feel is sufficient to uniquely identify a record) in your view to the 'name' attribute of the @Column annotation and designate this element with @Id annotation.

    Also please remember that there may not be a need to drop the view (Assuming that a working View is in place) because if the XSD doesn't map to the database entity it means that there is a problem with XSD, and we should try rectifying the problem in same.

    Here's an example of how you may do it:





    @Table(name="nameOfDatabaseView")





    @Id @Column(name="nameOfUniqueIdColumnInDatabaseView")


    \ t<--\tOther columns goes here\t-->




    And if you didn't make a search prior to posting, I would like to suggest to do so, as I remember there are some posts which resembles your query.
Reply
  • @manikandang You need to do two things here:
    1. Provide the name of the database view to the 'name' attribute of @Table annotation.
    2. Provide the name of the column (which ever you feel is sufficient to uniquely identify a record) in your view to the 'name' attribute of the @Column annotation and designate this element with @Id annotation.

    Also please remember that there may not be a need to drop the view (Assuming that a working View is in place) because if the XSD doesn't map to the database entity it means that there is a problem with XSD, and we should try rectifying the problem in same.

    Here's an example of how you may do it:





    @Table(name="nameOfDatabaseView")





    @Id @Column(name="nameOfUniqueIdColumnInDatabaseView")


    \ t<--\tOther columns goes here\t-->




    And if you didn't make a search prior to posting, I would like to suggest to do so, as I remember there are some posts which resembles your query.
Children
No Data