Added a method for removing DdlTypes from the DdlTypeRegistry (intended for internal use)
Signed-off-by: Jan Schatteman <jschatte@redhat.com>
This commit is contained in:
parent
b2fe35c297
commit
e26237dc0b
|
@ -13,11 +13,11 @@ import java.util.Map;
|
||||||
import java.util.TreeMap;
|
import java.util.TreeMap;
|
||||||
|
|
||||||
import org.hibernate.HibernateException;
|
import org.hibernate.HibernateException;
|
||||||
|
import org.hibernate.Internal;
|
||||||
import org.hibernate.dialect.Dialect;
|
import org.hibernate.dialect.Dialect;
|
||||||
import org.hibernate.engine.jdbc.Size;
|
import org.hibernate.engine.jdbc.Size;
|
||||||
import org.hibernate.type.SqlTypes;
|
import org.hibernate.type.SqlTypes;
|
||||||
import org.hibernate.type.descriptor.JdbcTypeNameMapper;
|
import org.hibernate.type.descriptor.JdbcTypeNameMapper;
|
||||||
import org.hibernate.type.descriptor.jdbc.JdbcType;
|
|
||||||
import org.hibernate.type.descriptor.sql.DdlType;
|
import org.hibernate.type.descriptor.sql.DdlType;
|
||||||
import org.hibernate.type.spi.TypeConfiguration;
|
import org.hibernate.type.spi.TypeConfiguration;
|
||||||
|
|
||||||
|
@ -78,6 +78,17 @@ public class DdlTypeRegistry implements Serializable {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Internal
|
||||||
|
public void removeDescriptor(int sqlTypeCode) {
|
||||||
|
final DdlType removable = ddlTypes.get( sqlTypeCode );
|
||||||
|
if ( removable != null ) {
|
||||||
|
for ( String rawTypeName : removable.getRawTypeNames() ) {
|
||||||
|
sqlTypes.remove( rawTypeName );
|
||||||
|
}
|
||||||
|
log.debugf( "removeDescriptor(%d) removed registration(%s)", sqlTypeCode, removable );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the {@link SqlTypes} type code for the given DDL raw type name, or <code>null</code> if it is unknown.
|
* Returns the {@link SqlTypes} type code for the given DDL raw type name, or <code>null</code> if it is unknown.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue