1
1
/*
2
- * Copyright 2002-2014 the original author or authors.
2
+ * Copyright 2002-2015 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.
@@ -154,6 +154,11 @@ public URL getPersistenceUnitRootUrl() {
154
154
return this .persistenceUnitRootUrl ;
155
155
}
156
156
157
+ /**
158
+ * Add a managed class name to the persistence provider's metadata.
159
+ * @see javax.persistence.spi.PersistenceUnitInfo#getManagedClassNames()
160
+ * @see #addManagedPackage
161
+ */
157
162
public void addManagedClassName (String managedClassName ) {
158
163
this .managedClassNames .add (managedClassName );
159
164
}
@@ -163,6 +168,15 @@ public List<String> getManagedClassNames() {
163
168
return this .managedClassNames ;
164
169
}
165
170
171
+ /**
172
+ * Add a managed package to the persistence provider's metadata.
173
+ * <p>Note: This refers to annotated {{package-info.java}} files. It does
174
+ * <i>not</i> trigger entity scanning in the specified package; this is
175
+ * rather the job of {@link DefaultPersistenceUnitManager#setPackagesToScan}.
176
+ * @since 4.1
177
+ * @see SmartPersistenceUnitInfo#getManagedPackages()
178
+ * @see #addManagedClassName
179
+ */
166
180
public void addManagedPackage (String packageName ) {
167
181
this .managedPackages .add (packageName );
168
182
}
@@ -262,7 +276,8 @@ public ClassLoader getNewTempClassLoader() {
262
276
263
277
@ Override
264
278
public String toString () {
265
- return "PersistenceUnitInfo: name '" + this .persistenceUnitName + "', root URL [" + this .persistenceUnitRootUrl + "]" ;
279
+ return "PersistenceUnitInfo: name '" + this .persistenceUnitName +
280
+ "', root URL [" + this .persistenceUnitRootUrl + "]" ;
266
281
}
267
282
268
283
}
0 commit comments