mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-07 11:48:18 +00:00
fix a couple of warnings in Configuration
This commit is contained in:
parent
2a904a46b2
commit
eed7ec0837
@ -64,7 +64,6 @@
|
||||
import jakarta.persistence.AttributeConverter;
|
||||
import jakarta.persistence.SharedCacheMode;
|
||||
|
||||
import static java.util.Collections.emptyList;
|
||||
|
||||
/**
|
||||
* A convenience API making it easier to bootstrap an instance of Hibernate.
|
||||
@ -199,11 +198,10 @@ public Configuration(MetadataSources metadataSources) {
|
||||
}
|
||||
|
||||
private static BootstrapServiceRegistry getBootstrapRegistry(ServiceRegistry serviceRegistry) {
|
||||
if ( serviceRegistry instanceof BootstrapServiceRegistry ) {
|
||||
return (BootstrapServiceRegistry) serviceRegistry;
|
||||
if ( serviceRegistry instanceof BootstrapServiceRegistry bootstrapServiceRegistry ) {
|
||||
return bootstrapServiceRegistry;
|
||||
}
|
||||
else if ( serviceRegistry instanceof StandardServiceRegistry ) {
|
||||
final StandardServiceRegistry ssr = (StandardServiceRegistry) serviceRegistry;
|
||||
else if ( serviceRegistry instanceof StandardServiceRegistry ssr ) {
|
||||
return (BootstrapServiceRegistry) ssr.getParentServiceRegistry();
|
||||
}
|
||||
|
||||
@ -669,7 +667,7 @@ public Configuration addResource(String resourceName) throws MappingException {
|
||||
* @throws MappingException Indicates problems locating the resource or
|
||||
* processing the contained mapping document.
|
||||
*/
|
||||
public Configuration addClass(Class entityClass) throws MappingException {
|
||||
public Configuration addClass(Class<?> entityClass) throws MappingException {
|
||||
if ( entityClass == null ) {
|
||||
throw new IllegalArgumentException( "The specified class cannot be null" );
|
||||
}
|
||||
@ -688,7 +686,7 @@ public Configuration addClass(Class entityClass) throws MappingException {
|
||||
*
|
||||
* @return {@code this} for method chaining
|
||||
*/
|
||||
public Configuration addAnnotatedClass(Class annotatedClass) {
|
||||
public Configuration addAnnotatedClass(Class<?> annotatedClass) {
|
||||
metadataSources.addAnnotatedClass( annotatedClass );
|
||||
return this;
|
||||
}
|
||||
@ -1153,7 +1151,7 @@ public Map<String, NamedResultSetMappingDescriptor> getSqlResultSetMappings() {
|
||||
}
|
||||
|
||||
public java.util.Collection<NamedEntityGraphDefinition> getNamedEntityGraphs() {
|
||||
return namedEntityGraphMap == null ? emptyList() : namedEntityGraphMap.values();
|
||||
return namedEntityGraphMap.values();
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user