我需要实时生成hbm int。因此我需要从dll中定义hbm文件。并且dll必须包含对此xml文件的引用。 如果这可能在NHibernate? 或者可以参考属性。 感谢
答案 0 :(得分:1)
不确定。 NHibernate几乎可以在任何地方加载hbms:
public class Configuration
{
public Configuration AddAssembly(Assembly assembly);
public Configuration AddAssembly(string assemblyName);
public Configuration AddClass(Type persistentClass);
public void AddDeserializedMapping(HbmMapping mappingDocument,
string documentFileName);
public Configuration AddDirectory(DirectoryInfo dir);
public Configuration AddDocument(XmlDocument doc);
public Configuration AddDocument(XmlDocument doc, string name);
public Configuration AddFile(FileInfo xmlFile);
public Configuration AddFile(string xmlFile);
public Configuration AddInputStream(Stream xmlInputStream);
public Configuration AddInputStream(Stream xmlInputStream, string name);
public Configuration AddResource(string path, Assembly assembly);
public Configuration AddResources(IEnumerable<string> paths,
Assembly assembly);
public Configuration AddUrl(string url);
public Configuration AddUrl(Uri url);
public Configuration AddXml(string xml);
public Configuration AddXml(string xml, string name);
public Configuration AddXmlFile(string xmlFile);
public Configuration AddXmlReader(XmlReader hbmReader);
public Configuration AddXmlReader(XmlReader hbmReader, string name);
public Configuration AddXmlString(string xml);
}