Commit Graph

150 Commits

Author SHA1 Message Date
Juergen Hoeller 277573fda8 support for Hibernate 4.0 as a JPA provider
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4544 50f2f4bb-b051-0410-bef5-90022cba6387
2011-06-14 22:45:29 +00:00
Juergen Hoeller 0c0db1b888 refined EntityManagerFactory proxy exception (SPR-4383)
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4538 50f2f4bb-b051-0410-bef5-90022cba6387
2011-06-14 15:02:40 +00:00
Juergen Hoeller 03adc3b632 shortened build properties "org.junit.version" to "junit.version" and "org.testng.version" to "testng.version"; reverted SLF4J version back to 1.5.3 (for Hibernate 3.3.1 compatibility)
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4502 50f2f4bb-b051-0410-bef5-90022cba6387
2011-06-09 09:58:15 +00:00
Juergen Hoeller df484f594f prefer use of varargs over arrays in bean property setters (for programmatic consumption)
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4501 50f2f4bb-b051-0410-bef5-90022cba6387
2011-06-09 09:15:11 +00:00
Juergen Hoeller 786ca258b9 updated dependencies
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4496 50f2f4bb-b051-0410-bef5-90022cba6387
2011-06-08 22:51:21 +00:00
Juergen Hoeller cfd8d7dac4 added "packagesToScan" feature to LocalContainerEntityManagerFactoryBean (avoiding persistence.xml)
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4482 50f2f4bb-b051-0410-bef5-90022cba6387
2011-06-07 16:56:47 +00:00
Juergen Hoeller 9c0f443890 fixed JPA 2.0 timeout hints to correctly specify milliseconds (SPR-8086)
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4369 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-29 20:52:03 +00:00
Chris Beams e8d1df5037 Fix generics and serialization warnings
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4249 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-06 19:00:14 +00:00
Chris Beams bb4f48dcb3 Automatically close SessionFactory objects
SessionFactory objects created by
SessionFactoryBuilderSupport#buildSessionFactory are now DisposableBean
proxies that call SessionFactory#close and release any threadlocal
DataSource object.

This is the same behavior that has always occurred during LSFBean and
ASFBean destruction lifecycles (and still does). This destruction logic
has now been factored out into
SessionFactoryBuilderSupport#closeHibernateSessionFactory such that all
SFB types can reuse it easily.

Note that LSFBean and ASFBean are subclasses, respectively, of SFBuilder
and ASFBuilder and they each must disable the DisposableBean proxying in
order to avoid duplicate attempts at closing the SessionFactory. See
the implementations of wrapSessionFactoryIfNeccesary() for details.

Issue: SPR-8114

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4240 50f2f4bb-b051-0410-bef5-90022cba6387
2011-04-26 10:15:30 +00:00
Chris Beams 0e2ce565c9 All SFBuilder setters return 'this' & use varargs
Touch up a few setter methods across the SessionFactoryBuilder
hierarchy that were still returning void.

Use varargs... syntax wherever possible.

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4151 50f2f4bb-b051-0410-bef5-90022cba6387
2011-03-31 14:28:30 +00:00
Chris Beams 9e8259198f Introduce (Annotation)SessionFactoryBuilder types
Large refactoring of existing *SessionFactoryBean hierarchy designed to
support configuration of Hibernate SessionFactory objects within
@Configuration class @Bean methods without forcing use of a
FactoryBean type, which is generally discouraged due to awkwardness
of programming model and lifecycle issues.  Refactored and new types
include:

    * Removal of AbstractSessionFactoryBean, replacing it with
      SessionFactoryBeanSupport abstract base class

    * Introduction of SessionFactoryBuilder and
      AnnotationSessionFactoryBuilder types, both direct subclasses of
      SessionFactoryBuilderSupport. These types are intended for direct
      use within @Bean methods. They expose method-chainable set*
      methods allowing for concise and convenient use. See JavaDoc
      on both types for usage examples.

    * LocalSessionFactoryBean and AnnotationSessionFactoryBean types are
      now subclasses, respectively, of the *Builder types above.

LSFB and ASFB backward-compatibility has been maintained almost
entirely. The one exception is that there is no longer a protected
convertHibernateAccessException() method available in the hierarchy.
This method was not likely often used anyway and has been replaced
by the new (and public) setPersistenceExceptionTranslator() which
accepts instances of type HibernateExceptionTranslator as introduced in
SPR-8076.

LSFB and ASFB setter method signatures have changed. They no longer
return void in standard JavaBeans style but rather, and due to extending
the *Builder types above, return the 'this' reference. This posed a
problem because the Spring container has to date been unable to detect
and provide dependency injection against non-void returning setter
methods. This limitation was due to the way that the default JavaBeans
Introspector class and its getBeanInfo() method works, and prompted the
introduction and intergration of ExtendedBeanInfo, already completed in
SPR-8079. So have no concern if you notice this signature change - it
all works.

Certain deprecations have been made:

    * All LSFB/ASFB methods related to Hibernate's CacheProvider SPI,
      reflecting its deprecation in Hibernate 3.3 in favor of the new
      RegionFactory SPI. Note these methods have been preserved only
      on the FactoryBean types. The new *SessionFactoryBuilder
      supertypes do not expose CacheProvider services at all.

    * All protected LSFB/ASFB methods that accept a Hibernate
      Configuration parameter, such as newSessionFactory(Configuration),
      postProcessMappings(Configuration) and
      postProcessConfiguration(Configuation), in favor of no-arg methods
      with the same names. Due to the nature of the hierarchy
      refactoring mentioned above, the Configuration instance is always
      available when these methods are called, thus no need to pass it
      in as a parameter.

In the process, our approach to automatic detection of Hibernate dialect
has been improved (it was in fact broken before). Thanks to James
Roper for his suggestion in SPR-7936 as to how to fix this.

See HibernateSessionFactoryConfigurationTests as a starting point for
understanding the new builder-style approach to SessionFactory creation.
Note especially use of the SessionFactoryBuilder#doWithConfiguration
method which allows for direct programmatic configuration of the Native
Hibernate (Annotation)Configuration API.

As a final note, AnnotationConfiguration has been deprecated in
Hibernate 3.6, and great pains have been taken to ensure that users
of any supported Hibernate version (3.2 -> 3.6) will never need to
(a) cast from Configuration to AnnotationConfiguration or (b)
experience deprecation warnings due to being forced to use the
AnnotationConfiguration API. Explore the JavaDoc around the
doWithConfiguration() method and HibernateConfigurationCallback type
for complete details.

Issue: SPR-8066, SPR-7936, SPR-8076, SPR-8098

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4147 50f2f4bb-b051-0410-bef5-90022cba6387
2011-03-31 12:29:12 +00:00
Chris Beams 48089d0925 Propagate wrapped exception in SessionFactoryUtils
Improve stack traces in certain Hibernate failure cases by properly
chaining the cause exception.

Issue: SPR-7933

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4146 50f2f4bb-b051-0410-bef5-90022cba6387
2011-03-31 12:07:30 +00:00
Chris Beams 54a5a39de9 Introduce HibernateExceptionTranslator
Designed to allow persistence exception translation of
HibernateException types without being forced to use
LocalSessionFactoryBean types.

Committed now in support of the forthcoming introduction of
*SessionFactoryBuilder types.

Issue: SPR-8076

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4145 50f2f4bb-b051-0410-bef5-90022cba6387
2011-03-31 12:06:58 +00:00
Sam Brannen fe5a764138 [SPR-8092] cleaning up ignored and broken ORM tests; suppressing warnings; fixed Eclipse classpath for tests.
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4122 50f2f4bb-b051-0410-bef5-90022cba6387
2011-03-28 18:16:45 +00:00
Sam Brannen da384be170 Polishing and fixed broken support for @IfProfileValue in AbstractJpaTests (even though it's deprecated).
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4118 50f2f4bb-b051-0410-bef5-90022cba6387
2011-03-28 17:23:48 +00:00
Chris Beams adc9400905 Include license.txt and notice.txt in module JARs
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3967 50f2f4bb-b051-0410-bef5-90022cba6387
2011-02-09 06:56:40 +00:00
Sam Brannen 924b8e11ea [SPR-7850][SPR-7851] Upgraded to JUnit 4.8.1 and TestNG 5.12.1; added changelog entries for 3.1.0.M1.
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3838 50f2f4bb-b051-0410-bef5-90022cba6387
2010-12-30 08:00:58 +00:00
Chris Beams 45e5b46fc2 Merge 3.1.0 development branch into trunk
Branch in question is 'env' branch from git://git.springsource.org/sandbox/cbeams.git; merged into
git-svn repository with:

    git merge -s recursive -Xtheirs --no-commit env

No merge conflicts, but did need to

    git rm spring-build

prior to committing.

With this change, Spring 3.1.0 development is now happening on SVN
trunk. Further commits to the 3.0.x line will happen in an as-yet
uncreated SVN branch.  3.1.0 snapshots will be available
per the usual nightly CI build from trunk.

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3782 50f2f4bb-b051-0410-bef5-90022cba6387
2010-10-25 19:48:20 +00:00
Juergen Hoeller ae5ffd68f4 AnnotationSessionFactoryBean's "postProcessConfiguration" is non-final now (because of Hibernate 3.6; SPR-7581)
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3694 50f2f4bb-b051-0410-bef5-90022cba6387
2010-09-29 13:22:24 +00:00
Juergen Hoeller e069c8fed6 updated version statement in javadoc
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3665 50f2f4bb-b051-0410-bef5-90022cba6387
2010-09-08 22:48:03 +00:00
Juergen Hoeller f85bad07d6 LocalSessionFactoryBean's "entityCacheStrategies" works with region names on Hibernate 3.6 as well
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3664 50f2f4bb-b051-0410-bef5-90022cba6387
2010-09-08 22:45:58 +00:00
Juergen Hoeller da758771fa consistent use of JDK 1.5's ThreadLocal.remove() over ThreadLocal.set(null), preventing leaks (SPR-7441)
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3627 50f2f4bb-b051-0410-bef5-90022cba6387
2010-09-01 17:17:25 +00:00
Ben Hale 82e5f5f5d6 Publishing license and notice files
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3612 50f2f4bb-b051-0410-bef5-90022cba6387
2010-08-23 13:17:31 +00:00
Arjen Poutsma 750dc01862 Prepping for 3.0.5
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3611 50f2f4bb-b051-0410-bef5-90022cba6387
2010-08-19 11:04:04 +00:00
Juergen Hoeller bcd552abfe polishing
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3592 50f2f4bb-b051-0410-bef5-90022cba6387
2010-08-15 23:01:10 +00:00
Juergen Hoeller b5656489d0 FilterDefinitionFactoryBean supports Hibernate 3.6.0.beta1 as well
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3509 50f2f4bb-b051-0410-bef5-90022cba6387
2010-07-27 00:04:23 +00:00
Juergen Hoeller cac618f38e DefaultJdoDialect supports JDO 3.0 query timeout facility (as supported by DataNucleus 2.1)
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3477 50f2f4bb-b051-0410-bef5-90022cba6387
2010-07-08 11:47:30 +00:00
Arjen Poutsma 7f54fe732f Upgrading version to 3.0.4
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3428 50f2f4bb-b051-0410-bef5-90022cba6387
2010-06-15 14:18:29 +00:00
Juergen Hoeller 644817b47a avoid EntityManager close() exception through isOpen() check (SPR-7215)
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3402 50f2f4bb-b051-0410-bef5-90022cba6387
2010-06-08 11:06:02 +00:00
Juergen Hoeller 8fad7f1520 avoid EntityManager close() exception through isOpen() check (SPR-7215)
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3401 50f2f4bb-b051-0410-bef5-90022cba6387
2010-06-08 10:21:05 +00:00
Juergen Hoeller af3512e929 properly return null from getPersistenceUnitInfo again (SPR-7055)
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3320 50f2f4bb-b051-0410-bef5-90022cba6387
2010-05-12 08:46:55 +00:00
Juergen Hoeller e8cfe6e573 changed "javax.persistence.criteria" import to an explicit Import-Package declaration (SPR-6636)
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3250 50f2f4bb-b051-0410-bef5-90022cba6387
2010-04-15 22:16:17 +00:00
David Syer faa0f29f0f Update version in POMs to 3.0.3
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3246 50f2f4bb-b051-0410-bef5-90022cba6387
2010-04-15 10:26:14 +00:00
Costin Leau 9a188fd461 SPR-7071
+ fix some Eclipse classpath entries

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3234 50f2f4bb-b051-0410-bef5-90022cba6387
2010-04-08 06:39:41 +00:00
Juergen Hoeller 974fe3035d DefaultPersistenceUnitManager's getPersistenceUnitInfo method has 2.5 compatible signature again (SPR-7055)
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3231 50f2f4bb-b051-0410-bef5-90022cba6387
2010-04-06 15:38:40 +00:00
Juergen Hoeller 6a9a595cd9 compatibility with Hibernate 3.5 final
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3217 50f2f4bb-b051-0410-bef5-90022cba6387
2010-04-01 11:37:35 +00:00
Juergen Hoeller 06342b82d6 ResourcePatternUtils provides plain PathMatchingResourcePatternResolver in case of a null ResourceLoader
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3213 50f2f4bb-b051-0410-bef5-90022cba6387
2010-04-01 10:35:49 +00:00
Juergen Hoeller f6e4621b17 added public "validateDatabaseSchema" method to Hibernate LocalSessionFactoryBean (SPR-3212)
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3152 50f2f4bb-b051-0410-bef5-90022cba6387
2010-03-24 09:36:01 +00:00
Juergen Hoeller 2c71b5b5ff compatibility with OpenJPA 2.0 (support for persistence.xml versioning; SPR-6975)
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3104 50f2f4bb-b051-0410-bef5-90022cba6387
2010-03-12 23:10:06 +00:00
Juergen Hoeller aea5a7183a use target factory's ClassLoader in case of a raw EntityManagerFactory (SPR-6733)
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3048 50f2f4bb-b051-0410-bef5-90022cba6387
2010-03-04 11:13:28 +00:00
Juergen Hoeller 61188f183b HibernateJpaDialect borrows JDBC Connection on demand (supporting aggressive release; SPR-6895)
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3032 50f2f4bb-b051-0410-bef5-90022cba6387
2010-02-23 16:13:04 +00:00
David Syer 25ef81476d Update Central POMs to 3.0.2
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3022 50f2f4bb-b051-0410-bef5-90022cba6387
2010-02-21 15:32:18 +00:00
Costin Leau 4be6044db9 + make use or property placeholders inside template.mf
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3014 50f2f4bb-b051-0410-bef5-90022cba6387
2010-02-19 09:43:22 +00:00
Juergen Hoeller 09d3d8b8fe made PersistenceAnnotationBeanPostProcessor's JNDI API references optional - for compatibility with Google App Engine (SPR-6679)
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@2953 50f2f4bb-b051-0410-bef5-90022cba6387
2010-02-11 11:36:33 +00:00
Juergen Hoeller 127553f9a7 polishing
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@2945 50f2f4bb-b051-0410-bef5-90022cba6387
2010-02-10 21:29:13 +00:00
Juergen Hoeller 23ede98efe compatibility with Hibernate 3.5 beta 4 (SPR-6804, SPR-6805)
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@2930 50f2f4bb-b051-0410-bef5-90022cba6387
2010-02-06 16:15:12 +00:00
Costin Leau 5e677feda0 + upgrade to AspectJ 1.6.8
+ externalize some of the jar versions
+ align the versions of some dependencies between pom.xml and ivy.xml

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@2918 50f2f4bb-b051-0410-bef5-90022cba6387
2010-02-04 11:46:21 +00:00
Costin Leau 0ade90451c + add explicit dependency on commons-pool to prevent version 1.3 from being used (since it contains a memory leak)
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@2914 50f2f4bb-b051-0410-bef5-90022cba6387
2010-02-04 10:05:54 +00:00
Juergen Hoeller 6ad560d205 polishing
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@2891 50f2f4bb-b051-0410-bef5-90022cba6387
2010-02-01 14:51:54 +00:00
Juergen Hoeller 37a23acbe2 SharedEntityManagerCreator's EntityManager proxies are fully serializable now (SPR-6684)
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@2890 50f2f4bb-b051-0410-bef5-90022cba6387
2010-02-01 14:48:18 +00:00