javadoc about properties in Configuration
This commit is contained in:
parent
af679e1d96
commit
edb3c335b2
|
@ -81,6 +81,19 @@ import jakarta.persistence.SharedCacheMode;
|
||||||
* format, or in Hibernate's legacy {@code .hbm.xml} format.
|
* format, or in Hibernate's legacy {@code .hbm.xml} format.
|
||||||
* <p>
|
* <p>
|
||||||
* Configuration properties are enumerated by {@link AvailableSettings}.
|
* Configuration properties are enumerated by {@link AvailableSettings}.
|
||||||
|
* <p>
|
||||||
|
* When instantiated, an instance of {@code Configuration} has its properties
|
||||||
|
* initially populated from the {@linkplain Environment#getProperties()
|
||||||
|
* environment}, including:
|
||||||
|
* <ul>
|
||||||
|
* <li>JVM {@linkplain System#getProperties() system properties}, and
|
||||||
|
* <li>properties specified in {@code hibernate.properties}.
|
||||||
|
* </ul>
|
||||||
|
* <p>
|
||||||
|
* These initial properties may be completely discarded by calling
|
||||||
|
* {@link #setProperties(Properties)}, or they may be overridden
|
||||||
|
* individually by calling {@link #setProperty(String, String)}.
|
||||||
|
* <p>
|
||||||
* <pre>
|
* <pre>
|
||||||
* SessionFactory factory = new Configuration()
|
* SessionFactory factory = new Configuration()
|
||||||
* // scan classes for mapping annotations
|
* // scan classes for mapping annotations
|
||||||
|
|
|
@ -163,7 +163,7 @@ public final class Environment implements AvailableSettings {
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Properties systemProperties = System.getProperties();
|
final Properties systemProperties = System.getProperties();
|
||||||
// Must be thread-safe in case an application changes System properties during Hibernate initialization.
|
// Must be thread-safe in case an application changes System properties during Hibernate initialization.
|
||||||
// See HHH-8383.
|
// See HHH-8383.
|
||||||
synchronized (systemProperties) {
|
synchronized (systemProperties) {
|
||||||
|
@ -183,11 +183,11 @@ public final class Environment implements AvailableSettings {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The {@link System#getProperties() system properties}, extended with all
|
* The {@linkplain System#getProperties() system properties}, extended
|
||||||
* additional properties specified in {@code hibernate.properties}.
|
* with all additional properties specified in {@code hibernate.properties}.
|
||||||
*/
|
*/
|
||||||
public static Properties getProperties() {
|
public static Properties getProperties() {
|
||||||
Properties copy = new Properties();
|
final Properties copy = new Properties();
|
||||||
copy.putAll(GLOBAL_PROPERTIES);
|
copy.putAll(GLOBAL_PROPERTIES);
|
||||||
return copy;
|
return copy;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue