Packageentity; importorg. hibernate. session; importorg. hibernate. sessionFactory; importorg. hibernate. cfg. configuration; importorg. hibernate. service. serviceRegistry; importorg. hibernate. service. serviceRegistryBuilder; importorg. hibernate. tool... mysqlhibernatepolicsist
Package entity;
Import org. hibernate. Session;
Import org. hibernate. SessionFactory;
Import org. hibernate. cfg. Configuration;
Import org. hibernate. service. ServiceRegistry;
Import org. hibernate. service. ServiceRegistryBuilder;
Import org. hibernate. tool. hbm2ddl. SchemaExport;
Import org. junit. Test;
Public class TestStudents {
@ Test
Public void testSchemaExport ()
{
// Create a configuration object
Configuration config = new Configuration (). configure ();
// Create a service registration object
ServiceRegistry serviceRegistry = new ServiceRegistryBuilder (). applySettings (config. getProperties (). buildServiceRegistry ();
// Create sessionFactory
SessionFactory sessionFactory = config. buildSessionFactory (serviceRegistry );
// Create a session object
Session session = sessionFactory. getCurrentSession ();
// Create a SchemaExport object
SchemaExport export = new SchemaExport (config );
Export. create (true, true );
}
}
September 20 2:40:45 am org. hibernate. annotations. common. Version
INFO: HCANN000001: Hibernate Commons Annotations {4.0.2.Final}
September 20 2:40:46 am org. hibernate. Version logVersion
INFO: HHH000412: Hibernate Core {4.2.4.Final}
September 20 2:40:46 am org. hibernate. cfg. Environment
INFO: HHH000206: hibernate. properties not found
September 20 2:40:46 am org. hibernate. cfg. Environment buildBytecodeProvider
INFO: HHH000021: Bytecode provider name: javassist
September 20 2:40:46 am org. hibernate. cfg. Configuration configure
INFO: HHH000043: processing ing from resource:/hibernate. cfg. xml
September 20 2:40:46 am org. hibernate. cfg. Configuration getConfigurationInputStream
INFO: HHH000040: Configuration resource:/hibernate. cfg. xml
September 20 2:40:46 org. hibernate. cfg. Configuration addResource
INFO: HHH000221: Reading mappings from resource: entity/Students. hbm. xml
September 20 2:40:46 org. hibernate. cfg. Configuration addResource
INFO: HHH000221: Reading mappings from resource: entity/Users. hbm. xml
September 20 2:40:46 am org. hibernate. cfg. Configuration doConfigure
INFO: HHH000041: Configured SessionFactory: null
September 20 2:40:46 am org. hibernate. service. jdbc. connections. internal. DriverManagerConnectionProviderImpl configure
INFO: HHH000402: Using Hibernate built-in connection pool (not for production use !)
September 20 2:40:46 am org. hibernate. service. jdbc. connections. internal. DriverManagerConnectionProviderImpl configure
INFO: HHH000115: Hibernate connection pool size: 20
September 20 2:40:46 am org. hibernate. service. jdbc. connections. internal. DriverManagerConnectionProviderImpl configure
INFO: HHH000006: Autocommit mode: false
September 20 2:40:46 am org. hibernate. service. jdbc. connections. internal. DriverManagerConnectionProviderImpl configure
INFO: HHH000401: using driver [com. mysql. jdbc. Driver] at URL [jdbc: mysql: // test? UseUnicode = true & characterEncoding = UTF-8]
September 20 2:40:46 am org. hibernate. service. jdbc. connections. internal. DriverManagerConnectionProviderImpl configure
INFO: HHH000046: Connection properties: {user = root, password = ****}
September 20 2:40:46 am org. hibernate. engine. jdbc. internal. JdbcServicesImpl configure
WARN: HHH000342: cocould not obtain connection to query metadata: Access denied for user 'root' @ 'localhost' (using password: NO)
September 20 2:40:46 am org. hibernate. dialect. Dialect
INFO: HHH000400: Using dialect: org. hibernate. dialect. MySQLDialect
September 20 2:40:46 am org. hibernate. engine. jdbc. internal. LobCreatorBuilder useContextualLobCreation
INFO: HHH000422: Disabling contextual LOB creation as connection was null
September 20 2:40:46 am org. hibernate. engine. transaction. internal. TransactionFactoryInitiator initiateService
INFO: HHH000399: Using default transaction strategy (direct JDBC transactions)
September 20 2:40:46 am org. hibernate. hql. internal. ast. ASTQueryTranslatorFactory
INFO: HHH000397: Using ASTQueryTranslatorFactory