remove operations that always threw UnsupportedOperationException

This commit is contained in:
Gavin King 2021-12-25 13:08:27 +01:00 committed by Steve Ebersole
parent a25aa20187
commit 2d10698d94
3 changed files with 1 additions and 49 deletions

View File

@ -314,31 +314,4 @@ public interface SessionFactory extends EntityManagerFactory, HibernateEntityMan
*/
@Deprecated
CollectionMetadata getCollectionMetadata(String roleName);
/**
* Retrieve the {@link ClassMetadata} for all mapped entities.
*
* @return A map containing all {@link ClassMetadata} keyed by the
* corresponding {@link String} entity-name.
*
* @throws HibernateException Generally empty map is returned instead of throwing.
*
* @since 3.0 changed key from {@link Class} to {@link String}.
*
* @deprecated Use the descriptors from {@link #getMetamodel()} instead
*/
@Deprecated
Map<String,ClassMetadata> getAllClassMetadata();
/**
* Get the {@link CollectionMetadata} for all mapped collections.
*
* @return a map from {@code String} to {@code CollectionMetadata}
*
* @throws HibernateException Generally empty map is returned instead of throwing.
*
* @deprecated Use the descriptors from {@link #getMetamodel()} instead
*/
@Deprecated
Map getAllCollectionMetadata();
}

View File

@ -127,16 +127,6 @@ public class SessionFactoryDelegatingImpl implements SessionFactoryImplementor,
return delegate.getCollectionMetadata( roleName );
}
@Override
public Map<String, ClassMetadata> getAllClassMetadata() {
return delegate.getAllClassMetadata();
}
@Override
public Map getAllCollectionMetadata() {
return delegate.getAllCollectionMetadata();
}
@Override
public StatisticsImplementor getStatistics() {
return delegate.getStatistics();

View File

@ -767,17 +767,7 @@ public class SessionFactoryImpl implements SessionFactoryImplementor {
return (ClassMetadata) getMetamodel().entityPersister( entityName );
}
@Override
public Map<String,ClassMetadata> getAllClassMetadata() throws HibernateException {
throw new UnsupportedOperationException( "org.hibernate.SessionFactory.getAllClassMetadata is no longer supported" );
}
public Map getAllCollectionMetadata() throws HibernateException {
throw new UnsupportedOperationException( "org.hibernate.SessionFactory.getAllCollectionMetadata is no longer supported" );
}
public Type getReferencedPropertyType(String className, String propertyName)
throws MappingException {
public Type getReferencedPropertyType(String className, String propertyName) throws MappingException {
return getMetamodel().entityPersister( className ).getPropertyType( propertyName );
}
@ -794,7 +784,6 @@ public class SessionFactoryImpl implements SessionFactoryImplementor {
* be a "heavy" object memory wise after close() has been called. Thus
* it is important to not keep referencing the instance to let the garbage
* collector release the memory.
* @throws HibernateException
*/
@Override
public void close() throws HibernateException {