File tree Expand file tree Collapse file tree 7 files changed +35
-5
lines changed
spring-orm-hibernate4/src/main/java/org/springframework/orm/jpa/vendor
spring-orm/src/main/java/org/springframework/orm/jpa Expand file tree Collapse file tree 7 files changed +35
-5
lines changed Original file line number Diff line number Diff line change 37
37
* is an alternative for compatibility with earlier Hibernate versions (3.6-4.2).
38
38
*
39
39
* @author Juergen Hoeller
40
+ * @author Joris Kuipers
40
41
* @since 4.1
42
+ * @see Configuration#addPackage
41
43
*/
42
44
class SpringHibernateJpaPersistenceProvider extends HibernatePersistenceProvider {
43
45
Original file line number Diff line number Diff line change @@ -149,6 +149,11 @@ public void setPersistenceUnitName(String persistenceUnitName) {
149
149
* <p>Default is none. Specify packages to search for autodetection of your entity
150
150
* classes in the classpath. This is analogous to Spring's component-scan feature
151
151
* ({@link org.springframework.context.annotation.ClassPathBeanDefinitionScanner}).
152
+ * <p><p>Note: There may be limitations in comparison to regular JPA scanning.</b>
153
+ * In particular, JPA providers may pick up annotated packages for provider-specific
154
+ * annotations only when driven by {@code persistence.xml}. As of 4.1, Spring's
155
+ * scan can detect annotated packages as well if supported by the given
156
+ * {@link JpaVendorAdapter} (e.g. for Hibernate).
152
157
* <p>If no explicit {@link #setMappingResources mapping resources} have been
153
158
* specified in addition to these packages, Spring's setup looks for a default
154
159
* {@code META-INF/orm.xml} file in the classpath, registering it as a mapping
Original file line number Diff line number Diff line change @@ -215,6 +215,11 @@ public void setDefaultPersistenceUnitName(String defaultPersistenceUnitName) {
215
215
* may live next to regularly defined units originating from {@code persistence.xml}.
216
216
* Its name is determined by {@link #setDefaultPersistenceUnitName}: by default,
217
217
* it's simply "default".
218
+ * <p><p>Note: There may be limitations in comparison to regular JPA scanning.</b>
219
+ * In particular, JPA providers may pick up annotated packages for provider-specific
220
+ * annotations only when driven by {@code persistence.xml}. As of 4.1, Spring's
221
+ * scan can detect annotated packages as well if supported by the given
222
+ * {@link org.springframework.orm.jpa.JpaVendorAdapter} (e.g. for Hibernate).
218
223
* <p>If no explicit {@link #setMappingResources mapping resources} have been
219
224
* specified in addition to these packages, this manager looks for a default
220
225
* {@code META-INF/orm.xml} file in the classpath, registering it as a mapping
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2002-2013 the original author or authors.
2
+ * Copyright 2002-2014 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
33
33
* Persistence Services (EclipseLink). Developed and tested against EclipseLink 2.4.
34
34
*
35
35
* <p>Exposes EclipseLink's persistence provider and EntityManager extension interface,
36
- * and supports {@link AbstractJpaVendorAdapter}'s common configuration settings.
36
+ * and adapts {@link AbstractJpaVendorAdapter}'s common configuration settings.
37
+ * No support for the detection of annotated packages (through
38
+ * {@link org.springframework.orm.jpa.persistenceunit.SmartPersistenceUnitInfo#getManagedPackages()})
39
+ * since EclipseLink doesn't use package-level metadata.
37
40
*
38
41
* @author Juergen Hoeller
39
42
* @author Thomas Risberg
40
43
* @since 2.5.2
44
+ * @see EclipseLinkJpaDialect
41
45
* @see org.eclipse.persistence.jpa.PersistenceProvider
42
46
* @see org.eclipse.persistence.jpa.JpaEntityManager
43
47
*/
Original file line number Diff line number Diff line change 40
40
* Hibernate EntityManager. Developed and tested against Hibernate 3.6 and 4.2/4.3.
41
41
*
42
42
* <p>Exposes Hibernate's persistence provider and EntityManager extension interface,
43
- * and supports {@link AbstractJpaVendorAdapter}'s common configuration settings.
43
+ * and adapts {@link AbstractJpaVendorAdapter}'s common configuration settings.
44
+ * Also supports the detection of annotated packages (through
45
+ * {@link org.springframework.orm.jpa.persistenceunit.SmartPersistenceUnitInfo#getManagedPackages()}),
46
+ * e.g. containing Hibernate {@link org.hibernate.annotations.FilterDef} annotations,
47
+ * along with Spring-driven entity scanning which requires no {@code persistence.xml}
48
+ * ({@link org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean#setPackagesToScan}).
44
49
*
45
50
* <p>Note that the package location of Hibernate's JPA support changed from 4.2 to 4.3:
46
51
* from {@code org.hibernate.ejb.HibernateEntityManager(Factory)} to
51
56
* @author Juergen Hoeller
52
57
* @author Rod Johnson
53
58
* @since 2.0
59
+ * @see HibernateJpaDialect
60
+ * @see org.hibernate.ejb.HibernatePersistence
61
+ * @see org.hibernate.ejb.HibernateEntityManager
54
62
*/
55
63
public class HibernateJpaVendorAdapter extends AbstractJpaVendorAdapter {
56
64
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2002-2012 the original author or authors.
2
+ * Copyright 2002-2014 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
33
33
* Developed and tested against OpenJPA 2.2.
34
34
*
35
35
* <p>Exposes OpenJPA's persistence provider and EntityManager extension interface,
36
- * and supports {@link AbstractJpaVendorAdapter}'s common configuration settings.
36
+ * and adapts {@link AbstractJpaVendorAdapter}'s common configuration settings.
37
+ * No support for the detection of annotated packages (through
38
+ * {@link org.springframework.orm.jpa.persistenceunit.SmartPersistenceUnitInfo#getManagedPackages()})
39
+ * since OpenJPA doesn't use package-level metadata.
37
40
*
38
41
* @author Costin Leau
39
42
* @author Juergen Hoeller
40
43
* @since 2.0
44
+ * @see OpenJpaDialect
41
45
* @see org.apache.openjpa.persistence.PersistenceProviderImpl
42
46
* @see org.apache.openjpa.persistence.OpenJPAEntityManager
43
47
*/
Original file line number Diff line number Diff line change 33
33
* <p>Compatible with Hibernate 3.6 as well as 4.0-4.2.
34
34
*
35
35
* @author Juergen Hoeller
36
+ * @author Joris Kuipers
36
37
* @since 4.1
38
+ * @see Ejb3Configuration#addPackage
37
39
*/
38
40
class SpringHibernateEjbPersistenceProvider extends HibernatePersistence {
39
41
You can’t perform that action at this time.
0 commit comments