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
Replies
4 replies
Subscribers
7 subscribers
Views
3402 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
Integrations
Team, I have a database view already created. I am now trying to crea
Manikandan Ganapathy
over 9 years ago
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
0
sikhivahans
over 9 years ago
@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.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Reply
0
sikhivahans
over 9 years ago
@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.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Children
No Data