Many to many relation between BO


Author
Message
justalex
justalex
StrataFrame Beginner (15 reputation)StrataFrame Beginner (15 reputation)StrataFrame Beginner (15 reputation)StrataFrame Beginner (15 reputation)StrataFrame Beginner (15 reputation)StrataFrame Beginner (15 reputation)StrataFrame Beginner (15 reputation)StrataFrame Beginner (15 reputation)StrataFrame Beginner (15 reputation)
Group: Forum Members
Posts: 7, Visits: 17
I have 3 Tables GroupsName, StudentGroups and of course Students



I have Multiple students that correspond to only one Group name from GroupsName and I want to alocate this in a new table because one student can migrate to another Group so I'm having in mind one combo box that will show the GroupsName and a listbox from where I can chose the Students and for each student chosen I add the corresponding ID's in the StudentGroups Table!



How would this be done ? or Is there a simple wey to do this ?
Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
It looks as though in this case you have a link table which is either StudentGroups or Groupnames.  You can use the BusinessLayerLinkManager to tie these tables together.  Using the BusinessLayerLinkManager class you can setup the relationship between each table and the link table.  You can then populate one BO and the other two can be automatically or dynamically populated without any additional code.

There are some other options as well, but I would first look at this and see if this is what you are looking for.

PeterA
PeterA
StrataFrame Novice (76 reputation)StrataFrame Novice (76 reputation)StrataFrame Novice (76 reputation)StrataFrame Novice (76 reputation)StrataFrame Novice (76 reputation)StrataFrame Novice (76 reputation)StrataFrame Novice (76 reputation)StrataFrame Novice (76 reputation)StrataFrame Novice (76 reputation)
Group: Forum Members
Posts: 72, Visits: 235
Hi! I was in the same spot as justalex and I'm trying to figure out the BLLM.



I think I understand how it works, but I'm not sure what exactly to assign to the TableX properties. Do I provide it the actual business object?



If so, I just need to rethink how I'm handling the Link Manager.



Thanks!



Peter
StrataFrame Team
S
StrataFrame Developer (4.7K reputation)StrataFrame Developer (4.7K reputation)StrataFrame Developer (4.7K reputation)StrataFrame Developer (4.7K reputation)StrataFrame Developer (4.7K reputation)StrataFrame Developer (4.7K reputation)StrataFrame Developer (4.7K reputation)StrataFrame Developer (4.7K reputation)StrataFrame Developer (4.7K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
Yes, you would have 3 business objects, one for each side of the m2m relationship and one for the link table.  Set those 3 properties and then set the string[]s that define the relationships between them and it will manage the rest.  It doesn't matter which one you set for Table1 or Table2, but you obviously have to set the link table as the TableLink Wink
PeterA
PeterA
StrataFrame Novice (76 reputation)StrataFrame Novice (76 reputation)StrataFrame Novice (76 reputation)StrataFrame Novice (76 reputation)StrataFrame Novice (76 reputation)StrataFrame Novice (76 reputation)StrataFrame Novice (76 reputation)StrataFrame Novice (76 reputation)StrataFrame Novice (76 reputation)
Group: Forum Members
Posts: 72, Visits: 235
Ok. I have a new question now. I've been playing with the settings trying to get this all working and I'm about 95% of the way there.



I've got a Dictionary object of key => BusinessLayerLinkManager so I can easily deal with my Links. Unfortunately, I think it doesn't like my very-normalized data model. Here's the situation:



1) Two M2M relationships, spread across 5 BOs.

2) Two BLLM elements of the aforementioned dictionary.



The relationships are:



1) object 1 -> link 1 -> object 2

2) object 2 -> link 2 -> object 3



It populates object 1 correctly and pulls the single record I need. Object 2 is a list of contacts associated with object 1 and it pulls all the associated contacts into the business object no problem. The trouble I have is when I use the contacts (object 2) to link to the contacts individual roles. It pulls the roles (object 3) contents fine and populates the list correctly for the contact. Then, I navigate to the next contact (in object 2) and it changes the list of roles, but the contact information doesn't actually change.



I've got every property in link1 that would automatically fill object 2 set to false (or no filter), but I still run into the same issue.



Do you guys have some detailed documentation on how behavior changes based on the value of the BLLM properties or a really good example of how to use the BLLM?



Thanks!



Peter
StrataFrame Team
S
StrataFrame Developer (4.7K reputation)StrataFrame Developer (4.7K reputation)StrataFrame Developer (4.7K reputation)StrataFrame Developer (4.7K reputation)StrataFrame Developer (4.7K reputation)StrataFrame Developer (4.7K reputation)StrataFrame Developer (4.7K reputation)StrataFrame Developer (4.7K reputation)StrataFrame Developer (4.7K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
When you say that the contact information does not change, do you mean that when you navigate Object2, it stays on the same record and doesn't go to the next one?  Are you using a Navigate() method, or a Move() method?
PeterA
PeterA
StrataFrame Novice (76 reputation)StrataFrame Novice (76 reputation)StrataFrame Novice (76 reputation)StrataFrame Novice (76 reputation)StrataFrame Novice (76 reputation)StrataFrame Novice (76 reputation)StrataFrame Novice (76 reputation)StrataFrame Novice (76 reputation)StrataFrame Novice (76 reputation)
Group: Forum Members
Posts: 72, Visits: 235
Ben Chase (09/13/2007)
When you say that the contact information does not change, do you mean that when you navigate Object2, it stays on the same record and doesn't go to the next one? Are you using a Navigate() method, or a Move() method?




I mean that it stayed on the same record. I'm using a Navigate() method.



I think I've got it figured out. I'm still working out some kinks, but I seem to have figured out the relationship portion. I am still interested in seeing any detailed documentation you guys have on the BLLM. I'm currently guessing how a business object is going to behave when I change a property (the names of each property seem self-explanatory), but I'd rather not guess. It would be nice to know how each property changes the behavior of the link and what the default values of each property/behavior are.



Thanks!

StrataFrame Team
S
StrataFrame Developer (4.7K reputation)StrataFrame Developer (4.7K reputation)StrataFrame Developer (4.7K reputation)StrataFrame Developer (4.7K reputation)StrataFrame Developer (4.7K reputation)StrataFrame Developer (4.7K reputation)StrataFrame Developer (4.7K reputation)StrataFrame Developer (4.7K reputation)StrataFrame Developer (4.7K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
We don't have any documentation in the help file on the use of the BLLM.  However, the descriptions of the properties within the property sheet should go a long way towards telling you what the name leaves out.  As always, though, if you have a question about one of the properties, just ask Smile
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search