提交 4f1d9fdd 编写于 作者: J Juergen Hoeller

Explicit documentation on MutablePersistenceUnitInfo's addManagedPackage

Issue: SPR-12821
上级 370e3a52
/*
* 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");
* you may not use this file except in compliance with the License.
......@@ -154,6 +154,11 @@ public class MutablePersistenceUnitInfo implements SmartPersistenceUnitInfo {
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) {
this.managedClassNames.add(managedClassName);
}
......@@ -163,6 +168,15 @@ public class MutablePersistenceUnitInfo implements SmartPersistenceUnitInfo {
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) {
this.managedPackages.add(packageName);
}
......@@ -262,7 +276,8 @@ public class MutablePersistenceUnitInfo implements SmartPersistenceUnitInfo {
@Override
public String toString() {
return "PersistenceUnitInfo: name '" + this.persistenceUnitName + "', root URL [" + this.persistenceUnitRootUrl + "]";
return "PersistenceUnitInfo: name '" + this.persistenceUnitName +
"', root URL [" + this.persistenceUnitRootUrl + "]";
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册