Commit Graph

42 Commits

Author SHA1 Message Date
Juergen Hoeller
62e5b9da04 LocalContainerEntityManagerFactoryBean's "persistenceUnitName" applies to "packagesToScan" as well; DefaultPersistenceUnitManager uses containing jar as persistence unit root URL for default unit (SPR-8832) 2012-02-07 20:59:48 +01:00
Chris Beams
88913f2b23 Convert CRLF (dos) to LF (unix)
Prior to this change, roughly 5% (~300 out of 6000+) of files under the
source tree had CRLF line endings as opposed to the majority which have
LF endings.

This change normalizes these files to LF for consistency going forward.

Command used:

$ git ls-files | xargs file | grep CRLF | cut -d":" -f1 | xargs dos2unix

Issue: SPR-5608
2011-12-21 14:52:47 +01:00
Rossen Stoyanchev
63e235f215 SPR-8750 Refine 'Content-Type' update in MockHttpServletRequest/Response.
The initial solution kept these three in full sync at all times:
contentType field, characterEncoding field, 'Content-Type' header.
That is correct behavior, however it breaks existing tests that rely
on contentType and characterEncoding being equal to exactly what 
they were set to.

For example, consider:
response.setContentType("text/plain");
response.setCharacterEncoding("UTF-8");

Ideally both contentType and the 'Content-Type' header would now be
"text/plain;charset=UTF-8". However, existing tests would expect 
that contentType is equal to "text/plain".

To avoid breaking existing tests, contentType and characterEncoding
will continue to be equal to exactly what they were set to while
the 'Content-Type' header will always include both the content 
type and the charset.

The only exception to this rule is when a 'Content-Type' header
is set explicitly, the contentType and characterEncoding fields will 
be updated accordingly, possibly overriding the existing values.
2011-11-17 15:07:15 +00:00
Rossen Stoyanchev
7918810366 SPR-8750 Update MockHttpServletRequest/Response handling of contentType.
The Content-Type header and the contentType field in HttpServletRequest/Response
are now always in sync. When a header is added the contentType field is updated
as well and vice versa. 

Similarly when the Content-Type header or the contentType field includes a charset 
field, the character encoding is updated and vice versa.
2011-11-16 23:28:48 +00:00
Juergen Hoeller
d54922642c made compilation work with Hibernate 4.0 next to Hibernate 3.x 2011-10-11 01:53:43 +00:00
Chris Beams
3bb01ee68b Revert "Introduce (Annotation)SessionFactoryBuilder types"
This commit and the several before it back out the
SessionFactoryBuilder and AnnotationSessionFactoryBuilder types
recently introduced in 3.1 M2. This is in light of the impending
release of Hibernate 4.0 GA and our own support for it the new
org.springframework.orm.hibernate4 package (not yet committed).

This new package will have a similar, but far simpler, arrangement of
a single LocalSessionFactoryBuilder and LocalSessionFactoryBean pair.
Hibernate 3.x support will remain largely as-is, however the
HibernateTransactionManager introduced with SPR-8076 will remain.

This reverts commit 9e8259198f07e495fd32359c0e0c197bb79a2ca0.

Issue: SPR-8066, SPR-7936, SPR-8076, SPR-8098, SPR-8096, SPR-7387
2011-10-09 07:55:52 +00:00
Juergen Hoeller
49e61d2680 overridden @PersistenceContext annotations on subclass methods are being processed correctly (SPR-8594) 2011-08-12 13:54:17 +00:00
Juergen Hoeller
8bae96bdd7 fixed HibernateMultiEntityManagerFactoryIntegrationTests failure 2011-07-26 00:59:41 +00:00
Juergen Hoeller
d8f29cb746 polishing 2011-07-26 00:46:39 +00:00
Juergen Hoeller
83df082930 moved OpenSessionInViewTests back to orm module 2011-07-26 00:46:07 +00:00
Juergen Hoeller
6ad8a4a79a fixed OpenEntityManagerInViewTests through the addition of a local copy of our Servlet API mocks; restoredOpenPersistenceManagerInViewTests 2011-07-26 00:38:05 +00:00
Juergen Hoeller
c31b17fef2 JpaTransactionManager etc can find EntityManagerFactory by "persistenceUnitName" property now, falling back to retrieval of a unique EntityManagerFactory bean by type (analogous to @PersistenceUnit / @PersistenceContext) 2011-07-25 12:28:16 +00:00
Juergen Hoeller
676ab5f0b1 restored OpenEntityManagerInViewTests 2011-07-25 12:15:33 +00:00
Juergen Hoeller
1b26b4744f fixed ignored test 2011-07-21 10:34:32 +00:00
Chris Beams
f5768fe00b 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
2011-03-31 12:29:12 +00:00
Sam Brannen
daa074734f [SPR-8092] cleaning up ignored and broken ORM tests; suppressing warnings; fixed Eclipse classpath for tests. 2011-03-28 18:16:45 +00:00
Sam Brannen
726564c84d Polishing and fixed broken support for @IfProfileValue in AbstractJpaTests (even though it's deprecated). 2011-03-28 17:23:48 +00:00
Juergen Hoeller
91a53a36ec LocalSessionFactoryBean's "entityCacheStrategies" works with region names on Hibernate 3.6 as well 2010-09-08 22:45:58 +00:00
Juergen Hoeller
e12fbd3e2b avoid EntityManager close() exception through isOpen() check (SPR-7215) 2010-06-08 11:06:02 +00:00
Juergen Hoeller
928f5423af avoid EntityManager close() exception through isOpen() check (SPR-7215) 2010-06-08 10:21:05 +00:00
Juergen Hoeller
6aa0e62597 compatibility with Hibernate 3.5 final 2010-04-01 11:37:35 +00:00
Juergen Hoeller
db71811c5a SharedEntityManagerCreator's EntityManager proxies are fully serializable now (SPR-6684) 2010-02-01 14:48:18 +00:00
Juergen Hoeller
a6769d60c0 fixed support for JPA 2.0 persistence schema (SPR-6711) 2010-01-18 19:26:52 +00:00
David Syer
b7e37ddb07 SPR-5327: tidy up Maven dependencies (keeping commons-logging) 2009-11-30 12:57:11 +00:00
Juergen Hoeller
46cd083976 added chaining-capable "add" method to MutablePropertyValues 2009-11-19 22:30:35 +00:00
Juergen Hoeller
eb0b4f0cbd added support for Hibernate 3.3 RegionFactory cache SPI to LocalSessionFactoryBean (SPR-6387) 2009-11-19 15:39:11 +00:00
Juergen Hoeller
54221500c1 fixed PersistenceInjectionTests 2009-10-20 18:30:55 +00:00
Mark Pollack
69422e771f SPR-5619 - (OpenSessionInViewTests, ClassUtilTests fixed)
Update org.sf.web/.classpath to refer to tiles 2.1.2
2009-07-10 03:30:12 +00:00
Sam Brannen
af56f6497c Updated regarding generics; fixed typos. 2009-05-25 09:04:05 +00:00
Juergen Hoeller
4cc42bf16f added "flush()" method to TransactionStatus and TransactionSynchronization interfaces; test context manager automatically flushes transactions before rolling back; general polishing of transaction management code 2009-02-19 00:24:05 +00:00
Juergen Hoeller
15bbd575a9 bridge method resolution works with Hibernate-generated CGLIB proxies as well (SPR-5414) 2009-02-16 01:35:35 +00:00
Juergen Hoeller
e7465dcb99 generified operations interfaces; update to JDO 2.1; preparation for JPA 2.0 2009-01-25 23:20:41 +00:00
Chris Beams
aee972c5b1 re-adding mock.jndi.* artifacts to .orm test codebase eliminated after moving away from svn:externals 2008-12-18 22:30:35 +00:00
Chris Beams
579280d7bf Whitespace polishing: leading spaces->tabs; updated eclipse configuration to default to leading tabs for all bundles 2008-12-18 14:50:25 +00:00
Chris Beams
f4d8b69126 moving unit tests from .testsuite -> .orm 2008-12-17 05:33:45 +00:00
Juergen Hoeller
347f34c68a EL container integration; support for contextual objects; removal of deprecated Spring 2.0 functionality; Java 5 code style 2008-11-20 02:10:53 +00:00
Arjen Poutsma
7a58c0e76f Moved tests from testsuite to orm 2008-10-30 16:55:52 +00:00
Arjen Poutsma
fdd12e9a2f Moved tests from testsuite to orm 2008-10-30 16:55:08 +00:00
Arjen Poutsma
434c744842 Moved tests from testsuite to orm 2008-10-30 16:48:56 +00:00
Arjen Poutsma
3620181a10 Moved tests from testsuite to orm 2008-10-30 16:46:52 +00:00
Arjen Poutsma
b7584189f5 Moved tests from testsuite to orm 2008-10-30 16:42:34 +00:00
Arjen Poutsma
d1061e7e9f Initial import of ORM 2008-10-24 09:06:30 +00:00