I want to create a Entity which can hold fields which will be dynamic
Let's say I have a Entity named Party and another entity named People, each party can hold N number of people names
How should I create such record?
Is there any other way other than creating fields like People1, People2 as lookup to the people entity?
You should look what N:N relationship is. You will not have exactly fields but you will have possibility to put subgrid of People type to Party entity to know what People belong to this Party and vice versa.
Related
I have three entities that need to be linked. In my scenario, I have three tables users, stores and accounts.
Both users and stores can have zero or one account and each account should be either for a store or a user (see image below).
I need a one-to-one relationship between user-account and store-account. Since one-to-one relationship force the model to use one key, the user and store Ids might have conflict.
Is there any solution for this in Entity Framework or do I have a flaw in my design?
It would be much easier to use intermediate tables user_account and store_account, that would store only keys. This way you can enforce any logic you want.
Is there a standard way in CUBA to modelize attributes for many-to-many association ? Documentation omits the topic so I guess it is not. In this case, is this in the roadmap ?
For many-to-many association (e.g between Products and Providers), CUBA Studio generates automatically a link table (holding Provider ID and Product ID).
In order to handle specific attributes to this association (e.g Boolean preferredProvider) it would need to add the preferredProvider column in the link table and create a class holding the two IDs and the attribute.
It would also probably impact the platfom mechanism of fetching many-to-many associations.
I'm reasonably sure that CUBA Studio does not manage it as of 2.2.3 - no option in Studio GUI, nothing in doc. It is still of course possible to code the case manually but one would need to manually write JPQL. Not necessarily a big deal but losing a strong feature of the platform here just for one field.
So I created the preferredProvider field as a one-to-one association from Product to Provider, which is a valid workaround at the cost of an additional association.
BizAgi tables are used to view collections in 1-m relationships.
It is also possible to view m-m relationships from the point of view of one entity (thus, a 1-m relationship).
The add and delete buttons don't work with m-m relationships and no errors appear.
Has anybody used them successfully?
My interpretation with an example:
One contract has N clients, and one client has N different contracts. You want to use collections to represent this connection.
The only was I see of representing this information is to have a table of contracts, to which the edit/detail form shows a table of clients for that contract.
You might also want to consider using a form link as a column of that table.
Let me know if this is a correct interpretation.
I need to merge two business process flows based on two different entities.Maybe one can be a parent BPF and other one a child BPF. Is it possible to do that? if yes then how?
And is it possible to have the same business process flow with two entities? one as primary entity and other as secondary.
Any means by which we can achieve a relationship between two BPFs?
In CRM 2013 you can create a BPF with up to 5 different entities. The condition is that each entity you add should have a 1-to-many relationship with the previous entity.
Also, it is possible to copy-paste an existing BPF, use it with a different entity and even giving it the same display name.
Some additional high-level details can be found here:
http://msdynamicscrmblog.wordpress.com/2013/11/06/business-process-flows-in-dynamics-crm-2013/
Basically I have an entity that contains food dishes and another that contains wine. Each dish has wine recommendations. I need to be able to select a dish and see the wine recommendations that come with that dish. Different dishes can have the same wine recommended for it.
Normally in SQL I would create a link table to achieve this but I am a bit stumped here, can anyone help?
Core Data handles the details of "to-many" relationships under the hood for you, you don't need to make intermediary tables.
Open your Core Data .xcdatamodel file, select the Food Entity, and click Add Relationship. Name the relationship wines. Make its destination entity the Wine entity. Open the Data Model Inspector (option-cmd-3) and select To-Many Relationship.
Now select the Wine entity. Create a relationship called foods. In the Data Model Inspector make the relationship's Desination the Food entity, it's inverse relationship is wines and set it to be a To-Many Relationship as well.
Now each instance of Food can have many Wines and each instance of Wine can have many Foods.
If you are using Core Data, then you can simply create a Wine table in the database and use it's primary key as the foreign-key in the food-dishes table. What is not working in this design?