Print Page | Close Window

Span Query and many to many relationship

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce Classic
Forum Discription: For .NET 2.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=870
Printed Date: 26-Mar-2025 at 1:01am


Topic: Span Query and many to many relationship
Posted By: DataMan
Subject: Span Query and many to many relationship
Date Posted: 04-Jul-2008 at 8:01am

Hi there,

I've created a many to many relationship for two of my objects let's say Salesperson to Customers through Orders.

When I create a devExpress report based on a span query the records on a certain sales person I can't create the span between Salesperson to Customers because when I type in EntityRelations. the intellisense does not see my many to many relation.
 
Is it as easy as adding the many to many relationship to the EntityRelations collection and if so how do you do that?
 
Thanks
Jaydel
 



Replies:
Posted By: DataMan
Date Posted: 07-Jul-2008 at 9:40am
I've answered my own question when looking deeper into my Many to Many relationship.  When I created the relationship I used the wrong direction of relationship in the parameter.  When I fixed that direction I put back in the code for the span and it worked then.
 
You simply have to add any relations required to create the many to many join and the span will show the proper data.
 
 


Posted By: GregD
Date Posted: 07-Jul-2008 at 11:19am
>>
I've answered my own question when looking deeper into my Many to Many relationship.  When I created the relationship I used the wrong direction of relationship in the parameter.  When I fixed that direction I put back in the code for the span and it worked then.
 
You simply have to add any relations required to create the many to many join and the span will show the proper data.
<<
 
Sounds like you've got it, but just to be sure:  Any many-to-many relation is the result of two one-to-manys joined at the many side (i.e., 1-M-M-1).  For example, if you have a one-to-many relation between Customers and Orders and a one-to-many between SalesReps and Orders, then you have, implicitly, a many-to-many relation between Customers and Employees. A query for Customers could have a span that navigates from Customers to Orders and then from Orders to Employees. You shouldn't have to add any relation objects to do this, assuming that you have a relation object for each of the one-to-manys.
 
Greg Dunn
IdeaBlade
 



Print Page | Close Window