Why hibernated does not create tables automatically?

zhmt via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Feb 6 02:58:11 PST 2015


Hi,Arjan,Thx for your replies, I have tried your suggestion,

	MySQLDriver driver = new MySQLDriver();
	string url = MySQLDriver.generateUrl("10.211.55.10", 3306, 
"test");
	string[string] params = MySQLDriver.setUserAndPassword("root", 
"xxx");
	auto ds = new ConnectionPoolDataSourceImpl(driver, url, params);
	
	EntityMetaData schema = new SchemaInfoImpl!(Card);
	Dialect dialect = new MySQLDialect();
	auto factory = new SessionFactoryImpl(schema, dialect, ds);

	auto conn = ds.getConnection();
	scope(exit) conn.close();
	auto db = factory.getDBMetaData();
	db.updateDBSchema(conn, true, true);
	
	Card c = new Card;
	auto s = factory.openSession();
	scope(exit) s.close();
	s.save(c);

The table is not created. The same code works about two weeks 
ago, but fails today, it make me confused.


More information about the Digitalmars-d-learn mailing list