Explicit documentation on MutablePersistenceUnitInfo's addManagedPackage

Issue: SPR-12821
This commit is contained in:
Juergen Hoeller 2015-03-17 21:28:19 +01:00
parent 370e3a52bf
commit 4f1d9fddc8
1 changed files with 17 additions and 2 deletions

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2014 the original author or authors. * Copyright 2002-2015 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -154,6 +154,11 @@ public class MutablePersistenceUnitInfo implements SmartPersistenceUnitInfo {
return this.persistenceUnitRootUrl; return this.persistenceUnitRootUrl;
} }
/**
* Add a managed class name to the persistence provider's metadata.
* @see javax.persistence.spi.PersistenceUnitInfo#getManagedClassNames()
* @see #addManagedPackage
*/
public void addManagedClassName(String managedClassName) { public void addManagedClassName(String managedClassName) {
this.managedClassNames.add(managedClassName); this.managedClassNames.add(managedClassName);
} }
@ -163,6 +168,15 @@ public class MutablePersistenceUnitInfo implements SmartPersistenceUnitInfo {
return this.managedClassNames; return this.managedClassNames;
} }
/**
* Add a managed package to the persistence provider's metadata.
* <p>Note: This refers to annotated {{package-info.java}} files. It does
* <i>not</i> trigger entity scanning in the specified package; this is
* rather the job of {@link DefaultPersistenceUnitManager#setPackagesToScan}.
* @since 4.1
* @see SmartPersistenceUnitInfo#getManagedPackages()
* @see #addManagedClassName
*/
public void addManagedPackage(String packageName) { public void addManagedPackage(String packageName) {
this.managedPackages.add(packageName); this.managedPackages.add(packageName);
} }
@ -262,7 +276,8 @@ public class MutablePersistenceUnitInfo implements SmartPersistenceUnitInfo {
@Override @Override
public String toString() { public String toString() {
return "PersistenceUnitInfo: name '" + this.persistenceUnitName + "', root URL [" + this.persistenceUnitRootUrl + "]"; return "PersistenceUnitInfo: name '" + this.persistenceUnitName +
"', root URL [" + this.persistenceUnitRootUrl + "]";
} }
} }