Join Entities in different catalogs

Posts   
 
    
Posts: 12
Joined: 05-Aug-2010
# Posted on: 13-Aug-2010 16:13:03   

Hello,

What is the recommended to do do a JOIN on entities in different catalogs (and .NET assemblies)?

Thanks.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39749
Joined: 17-Aug-2003
# Posted on: 13-Aug-2010 17:00:08   

so in different projects? Which framework / llblgen pro version are you using?

Frans Bouma | Lead developer LLBLGen Pro
Posts: 12
Joined: 05-Aug-2010
# Posted on: 13-Aug-2010 17:45:54   

Sorry, I should be specifying these!

v3.0 Final NHibernate

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39749
Joined: 17-Aug-2003
# Posted on: 15-Aug-2010 13:13:08   

You want to keep the entity definitions also separated? Do you use a single session with multiple assemblies?

LLBLGen Pro supports multiple catalogs, and you can define in the project multiple groups which can represent multiple vs.net projects (assemblies), so you can define the entity (e.g. 'Product') multiple times in the project (e.g. in each group) and map it to the same target. This has the advantage that when the target table changes, all the entities mapped onto it are validated against it.

Frans Bouma | Lead developer LLBLGen Pro
Posts: 12
Joined: 05-Aug-2010
# Posted on: 16-Aug-2010 15:05:53   

We are using different (NHibernate) sessions with the multiple assemblies. The entities that we want to join are in these different assemblies. Currently, we are using LINQ to NHibernate to get the results.

In the cases where the entities were in the same assembly we use Typed Lists; so is it right that the typed lists cannot be used if the entities are in different assemblies?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39749
Joined: 17-Aug-2003
# Posted on: 16-Aug-2010 15:19:32   

You can only join entities which are in the same session factory, so if you have Customer in sessionfactory S1 with assembly A, and Order in session factory S2 with assembly B, you can't join them, using a session created on S1 or S2 as both sessionfactories don't know all the types.

Frans Bouma | Lead developer LLBLGen Pro
Posts: 12
Joined: 05-Aug-2010
# Posted on: 16-Aug-2010 16:25:45   

thanks for the explanation