I have two main entities (db tables)
- Project
- Application
I have a bridge tabled called ProjectApplication with 3 col (Id, ProjectId, ApplicationId)
A project can have many applications.
An application can below to many different project
Your basic many to many mapping
Currently this is what i have setup in my fluent nhibernate mapping files
public class ProjectMap
{
HasMany(x => x.ProjectApplications)
.AsBag().Inverse().Cascade.AllDeleteOrphan().Fetch.Select().BatchSize(80);
}
public class ApplicationMap
{
HasMany(x => x.ProjectsApplications)
.AsBag().Inverse().Fetch.Select().BatchSize(50);
}
Is there any downside to this as i see there is a HasManyToMany syntax so I am not sure if it makes a difference in terms of the Queries that are generated or performance, etc
Please advise
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…