我有这个 SQL 查询:
select pr.*, det.Description, det.Name
from Product pr
inner join ProductDetail det on det.Product_id = pr.id
where pr.Id = XX and det.IsDefault = yy
如何使用 QueryOver 做到这一点?
谢谢,
更新 :
public ProductMap()
{
Id(x => x.Id).GeneratedBy.Native();
Map(x => x.Code)
.Length(20)
.Not.Nullable();
Map(x => x.CreationDate).Not.Nullable();
Map(x => x.IsDeleted);
Map(x => x.Price);
HasManyToMany(x => x.Categories)
.AsSet()
.Cascade
.SaveUpdate()
.Table("ProductsCategories");
}
public class ProductDetailMap : ClassMap<ProductDetail>
{
public ProductDetailMap()
{
Id(x => x.Id).GeneratedBy.Native();
Map(x => x.Name)
.Length(50)
.Not.Nullable();
Map(x => x.Description)
.Length(250);
Map(x => x.IsDefault);
References(x => x.Language);
References(x => x.Product);
}
}