我们已经在hbm.xml中完成了一些映射,我宁愿不必以编程方式映射这些映射,你可以将它们混合在同一个sessionfactory中,直到我们有时间偿还债务吗?
是的.
绝对可以混合它们.我正在做我目前的项目.
我的SessionFactory结构看起来像这样:
_configuration = new Configuration();
_configuration.SetProperties(properties);
// hbm files
_configuration.AddAssembly(typeof(ISurveyTask).Assembly);
Run Code Online (Sandbox Code Playgroud)
...
var persistenceModel = new PersistenceModel(...)
// fluent mappings
persistenceModel.addMappingsFromAssembly(typeof(ISurveyTask).Assembly);
persistenceModel.Configure(_configuration);
Run Code Online (Sandbox Code Playgroud)
请享用 :-)
归档时间: |
|
查看次数: |
1744 次 |
最近记录: |