From: Juergen H. <jho...@us...> - 2006-04-21 00:14:28
|
Update of /cvsroot/springframework/spring/src/org/springframework/orm/hibernate3 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19629/src/org/springframework/orm/hibernate3 Modified Files: Tag: mbranch-1-2 FilterDefinitionFactoryBean.java LocalSessionFactoryBean.java Log Message: backported fixes and enhancements from 2.0 M4 (HEAD) Index: LocalSessionFactoryBean.java =================================================================== RCS file: /cvsroot/springframework/spring/src/org/springframework/orm/hibernate3/LocalSessionFactoryBean.java,v retrieving revision 1.20.2.4 retrieving revision 1.20.2.5 diff -C2 -d -r1.20.2.4 -r1.20.2.5 *** LocalSessionFactoryBean.java 23 Feb 2006 22:37:06 -0000 1.20.2.4 --- LocalSessionFactoryBean.java 21 Apr 2006 00:13:49 -0000 1.20.2.5 *************** *** 782,786 **** } } ! /** --- 782,786 ---- } } ! /** *************** *** 894,898 **** public Object doInHibernate(Session session) throws HibernateException, SQLException { Connection con = session.connection(); ! final Dialect dialect = Dialect.getDialect(configuration.getProperties()); String[] sql = configuration.generateSchemaCreationScript(dialect); executeSchemaScript(con, sql); --- 894,898 ---- public Object doInHibernate(Session session) throws HibernateException, SQLException { Connection con = session.connection(); ! Dialect dialect = Dialect.getDialect(configuration.getProperties()); String[] sql = configuration.generateSchemaCreationScript(dialect); executeSchemaScript(con, sql); *************** *** 913,922 **** * <p>Uses the SessionFactory that this bean generates for accessing a JDBC * connection to perform the script. ! * @throws HibernateException in case of Hibernate initialization errors * @see #setSchemaUpdate * @see org.hibernate.cfg.Configuration#generateSchemaUpdateScript * @see org.hibernate.tool.hbm2ddl.SchemaUpdate */ ! public void updateDatabaseSchema() throws HibernateException { logger.info("Updating database schema for Hibernate SessionFactory"); HibernateTemplate hibernateTemplate = new HibernateTemplate(this.sessionFactory); --- 913,922 ---- * <p>Uses the SessionFactory that this bean generates for accessing a JDBC * connection to perform the script. ! * @throws DataAccessException in case of script execution errors * @see #setSchemaUpdate * @see org.hibernate.cfg.Configuration#generateSchemaUpdateScript * @see org.hibernate.tool.hbm2ddl.SchemaUpdate */ ! public void updateDatabaseSchema() throws DataAccessException { logger.info("Updating database schema for Hibernate SessionFactory"); HibernateTemplate hibernateTemplate = new HibernateTemplate(this.sessionFactory); *************** *** 926,930 **** public Object doInHibernate(Session session) throws HibernateException, SQLException { Connection con = session.connection(); ! final Dialect dialect = Dialect.getDialect(configuration.getProperties()); DatabaseMetadata metadata = new DatabaseMetadata(con, dialect); String[] sql = configuration.generateSchemaUpdateScript(dialect, metadata); --- 926,930 ---- public Object doInHibernate(Session session) throws HibernateException, SQLException { Connection con = session.connection(); ! Dialect dialect = Dialect.getDialect(configuration.getProperties()); DatabaseMetadata metadata = new DatabaseMetadata(con, dialect); String[] sql = configuration.generateSchemaUpdateScript(dialect, metadata); Index: FilterDefinitionFactoryBean.java =================================================================== RCS file: /cvsroot/springframework/spring/src/org/springframework/orm/hibernate3/FilterDefinitionFactoryBean.java,v retrieving revision 1.2 retrieving revision 1.2.4.1 diff -C2 -d -r1.2 -r1.2.4.1 *** FilterDefinitionFactoryBean.java 19 Apr 2005 21:07:55 -0000 1.2 --- FilterDefinitionFactoryBean.java 21 Apr 2006 00:13:49 -0000 1.2.4.1 *************** *** 1,4 **** /* ! * Copyright 2002-2005 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); --- 1,4 ---- /* ! * Copyright 2002-2006 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); *************** *** 31,36 **** * Exposes a corresponding Hibernate FilterDefinition object. * ! * <p>Typically defined as inner bean within a LocalSessionFactoryBean ! * definition, as list element for the "filterDefinitions" bean property. * For example: * --- 31,36 ---- * Exposes a corresponding Hibernate FilterDefinition object. * ! * <p>Typically defined as an inner bean within a LocalSessionFactoryBean ! * definition, as the list element for the "filterDefinitions" bean property. * For example: * *************** *** 57,60 **** --- 57,66 ---- * instead of the "filterName" property. * + * <p><b>NOTE:</b> This FactoryBean uses Hibernate 3.0 API. Unfortunately, + * Hibernate 3.1 changed its FilterDefinition class in a non-backwards-compatible + * fashion. Consider defining filters within Hibernate's own configuration file + * instead of through this FactoryBean, if you intend to run on Hibernate 3.1. + * (As of Spring 2.0, this FactoryBean will use Hibernate 3.1 API.) + * * @author Juergen Hoeller * @since 1.2 |