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
6 subscribers
Views
2346 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
Process
Hi, I would like to know the Best Practice to be followed around this
senthilar
over 11 years ago
Hi,
I would like to know the Best Practice to be followed around this scenario -
As per the business requirement, there are lots of information which we should be grouping into CDTs - CustomerInformation and AccountInformation. And logically speaking, an Account can exist only for a Customer, so ideally we would be tempted to add AccountInformation CDT within CustomerInformation CDT. But there can be cases where we would have to persist AccountInformation alone without any need to persist CustomerInformation.
This being the case, which of these 2 approaches should be preferred? :
1) Have AccountInformation CDT within CustomerInformation CDT and everytime you want to persist AccountInformation, persist CustomerInformation as a whole.
2) Have AccountInformation CDT and CustomerInformation CDT separately. Persist them individually as per the need....
OriginalPostID-104079
OriginalPostID-104079
Discussion posts and replies are publicly visible
0
simonf
over 11 years ago
I would prefer approach 1, and for scenario when you only want to persist AccountInformation alone, you can create a simpler (flat) CDT of type AccountInformation which maps to the same table in your XSD with all the columns but the nested column of Customer Information. A good naming convention is to name the simpler type CDT from the same table with the same prefix, ie. AccountInformationCore/AccountInformationCore.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
simonf
over 11 years ago
Correction: ie. AccountInformationSimple/AccountInformationCore.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Eduardo Fuentes
Appian Employee
over 11 years ago
You can have two CDTs that point to the same tables .Whenever you need to write the nested one, if no relationship is needed, then you can simply use that one. With the use of the JPA annotations (e.g. @Table) you can map any CDT to any table and any CDT can definitely be a subset of fields.
If there's always a need for persisting the relationship you do need the parent CDT too.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
senthilar
over 11 years ago
Thank you Simonf and Eduardo!
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel