Right now, the session factory just finds all .hbm.xml files embedded in the current assembly it seems. I now have a situation where I only want the session factory to load the list of mappings that I specify. How can I do this?
Thanks,
Isaac
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can use the
Configuration.AddResources(IEnumerable<string> paths, Assembly assembly)and specify a desired list of mappings, do your own filtering if you insist having the mappings embedded in the same assembly. Otherwise I would recommend Sergio’s answer.You can use a static method on Configuration class to return a list of available mappings in an assembly, then you can remove the ones you don’t want: