Author: tchemit Date: 2013-07-13 15:16:04 +0200 (Sat, 13 Jul 2013) New Revision: 2760 Url: http://nuiton.org/projects/topia/repository/revisions/2760 Log: fixes #2755: Creating a schema should not droping it just before fixes #2756: Does not use hardcoded cast to hibernate implementation Modified: trunk/topia-persistence/src/main/java/org/nuiton/topia/framework/TopiaContextImpl.java Modified: trunk/topia-persistence/src/main/java/org/nuiton/topia/framework/TopiaContextImpl.java =================================================================== --- trunk/topia-persistence/src/main/java/org/nuiton/topia/framework/TopiaContextImpl.java 2013-07-13 13:11:07 UTC (rev 2759) +++ trunk/topia-persistence/src/main/java/org/nuiton/topia/framework/TopiaContextImpl.java 2013-07-13 13:16:04 UTC (rev 2760) @@ -37,9 +37,9 @@ import org.hibernate.SessionFactory; import org.hibernate.Transaction; import org.hibernate.cfg.Configuration; +import org.hibernate.engine.spi.SessionFactoryImplementor; import org.hibernate.event.service.spi.EventListenerRegistry; import org.hibernate.event.spi.EventType; -import org.hibernate.internal.SessionFactoryImpl; import org.hibernate.jdbc.Work; import org.hibernate.service.ServiceRegistry; import org.hibernate.service.ServiceRegistryBuilder; @@ -106,7 +106,7 @@ * <p/> * Created: 23 déc. 2005 16:58:50 * - * @author poussin <poussin@codelutin.com> + * @author bpoussin <poussin@codelutin.com> * @author tchemit <chemit@codelutin.com> * @author fdesbois <desbois@codelutin.com> * @version $Id$ @@ -473,8 +473,7 @@ showSchema = true; } getFiresSupport().firePreCreateSchema(this); - new SchemaExport(getHibernateConfiguration()).create(showSchema, - true); + new SchemaExport(getHibernateConfiguration()).execute(showSchema, true, false, true); getFiresSupport().firePostCreateSchema(this); } catch (HibernateException eee) { throw new TopiaException( @@ -537,7 +536,7 @@ // we can't reuse original serviceRegistry instance // we must call getServiceRegistry on factory to get a working one - ServiceRegistry serviceRegistryInit = ((SessionFactoryImpl)hibernateFactory).getServiceRegistry(); + ServiceRegistry serviceRegistryInit = ((SessionFactoryImplementor) hibernateFactory).getServiceRegistry(); EventListenerRegistry eventListenerRegistry = serviceRegistryInit.getService(EventListenerRegistry.class); TopiaFiresSupport.TopiaHibernateEvent listener = new TopiaFiresSupport.TopiaHibernateEvent(this);
participants (1)
-
tchemit@users.nuiton.org