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
3 replies
Subscribers
7 subscribers
Views
1289 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
AI and Rules
Hello, I would like to know if it's possible to construct a query
thanosm
over 9 years ago
Hello,
I would like to know if it's possible to construct a queryEntity to retrieve data by joining tables.
The case is that the main Entity that is being queried has IDs as values for fields and their description is on a different table, for which we have entities.
OriginalPostID-153616
OriginalPostID-153616
Discussion posts and replies are publicly visible
0
Tim
Certified Lead Developer
over 9 years ago
For this scenario you should be creating database level "View" objects to perform the joins and then map this to a CDT in Appian. You could also do it directly a CDT using the oneTo__ jpa annotations.
forum.appian.com/.../Custom_Data_Types_from_XSD.html
forum.appian.com/.../Database_Performance_Best_Practices.html
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Mike James
Certified Lead Developer
over 9 years ago
Exactly this...the queryEntity() function only allows access a single entity so any joins that you need to perform have to be managed in that datatype.
Alternately, and substantially less elegantly :-), you could use the queryEntity() to get your first data set with all the ID's and then run another to get all the fields from your second table and the marry them together into a single dataset myabe using something similar to the approach outlined in this recipe:
forum.appian.com/.../SAIL_Recipes.html
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
thanosm
over 9 years ago
@tim.clarke @mikej
Thank you both for your inputs as they both have helped me a lot.And @mikej, your suggestion gave me an idea as to how to use that methodology in my scenario.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel