Created
February 24, 2010 19:11
-
-
Save jfromaniello/313735 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fail = false; | |
var configuration = new Configuration().Configure(); | |
configuration.Properties[Environment.ShowSql] = "false"; | |
var sessionFactory = configuration.BuildSessionFactory(); | |
using (var session = sessionFactory.OpenSession()) | |
{ | |
var allClassMetadata = session.SessionFactory.GetAllClassMetadata(); | |
foreach (var entry in allClassMetadata) | |
{ | |
try | |
{ | |
session.CreateCriteria(entry.Key) | |
.SetMaxResults(0).List(); | |
Console.WriteLine("{0} mapping is ok.", entry.Key); | |
}catch(Exception ex) | |
{ | |
Console.WriteLine("{0} mapping is wrong. See the exception message:", entry.Key); | |
Console.WriteLine(ex.Message); | |
fail = true; | |
} | |
} | |
} | |
Assert.IsFalse(fail); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment