Skip to content

Commit 1a5dc23

Browse files
committed
NH-2997 - Add method Where to IManyToManyMapper
1 parent e7867e9 commit 1a5dc23

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

src/NHibernate/Mapping/ByCode/IManyToManyMapper.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@ public interface IManyToManyMapper : IColumnsMapper
88
void Formula(string formula);
99
void Lazy(LazyRelation lazyRelation);
1010
void ForeignKey(string foreignKeyName);
11+
void Where(string sqlWhereClause);
1112
}
1213
}

src/NHibernate/Mapping/ByCode/Impl/CustomizersImpl/ManyToManyCustomizer.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,11 @@ public void ForeignKey(string foreignKeyName)
6565
customizersHolder.AddCustomizer(propertyPath, (IManyToManyMapper x) => x.ForeignKey(foreignKeyName));
6666
}
6767

68+
public void Where(string sqlWhereClause)
69+
{
70+
customizersHolder.AddCustomizer(propertyPath, (IManyToManyMapper x) => x.Where(sqlWhereClause));
71+
}
72+
6873
#endregion
6974
}
7075
}

src/NHibernate/Mapping/ByCode/Impl/ManyToManyMapper.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,11 @@ public void ForeignKey(string foreignKeyName)
166166
manyToMany.foreignkey = foreignKeyName;
167167
}
168168

169+
public void Where(string sqlWhereClause)
170+
{
171+
manyToMany.where = sqlWhereClause;
172+
}
173+
169174
#endregion
170175
}
171176
}

0 commit comments

Comments
 (0)