Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 30th, 2012  |  syntax: None  |  size: 0.77 KB  |  hits: 13  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Fluently Hibernate DB2SQLConfiguration
  2. public class SessionFactory
  3. {
  4.     public static ISessionFactory create()
  5.     {
  6.         var config = Fluently.Configure();
  7.  
  8.             config.Database(PostgreSQLConfiguration.Standard.ConnectionString(c => c
  9.             .Host("localhost")
  10.             .Database("local")
  11.             .Username("adm")
  12.             .Password("adm")
  13.             .Port(5432)));          
  14.  
  15.         config.Mappings(m => m.FluentMappings.AddFromAssembly(Assembly.GetExecutingAssembly()));
  16.  
  17.         config.ExposeConfiguration(BuildSchema);
  18.  
  19.         return config.BuildSessionFactory();
  20.     }
  21. }
  22.        
  23. config.Database(DB2Configuration.Standard.ConnectionString(c => c
  24.     .Server("db-srv")
  25.     .Database("tables")
  26.     .Username("toni tester")
  27.     .Password("secret")
  28.     ));