public void setParameterValues( Properties parameters ) { String enumClassName = parameters.getProperty( "enumClass" ); try { enumClass = Class.forName( enumClassName ).asSubclass( Enum.class ); } catch ( ClassNotFoundException cfne ) { throw new HibernateException( "Enum class not found", cfne ); } String identifierMethodName = parameters.getProperty( "identifierMethod", DEFAULT_IDENTIFIER_METHOD_NAME ); try { identifierMethod = enumClass.getMethod( identifierMethodName, new Class[0] ); identifierType = identifierMethod.getReturnType(); } catch ( Exception e ) { throw new HibernateException( "Failed to obtain identifier method", e ); } type = ( NullableType ) TypeFactory.basic( identifierType.getName() ); if ( type == null ) throw new HibernateException( "Unsupported identifier type " + identifierType.getName() ); sqlTypes = new int[]{type.sqlType()}; String valueOfMethodName = parameters.getProperty( "valueOfMethod", DEFAULT_VALUE_OF_METHOD_NAME ); try { valueOfMethod = enumClass.getMethod( valueOfMethodName, new Class[]{identifierType} ); } catch ( Exception e ) { throw new HibernateException( "Failed to obtain valueOf method", e ); } }
@Override public void setParameterValues( Properties parameters ) { String enumClassName = parameters.getProperty( "enumClass" ); try { enumClass = Class.forName( enumClassName ).asSubclass( Enum.class ); } catch ( ClassNotFoundException cfne ) { throw new HibernateException( "Enum class not found", cfne ); } String identifierMethodName = parameters.getProperty( "identifierMethod", DEFAULT_IDENTIFIER_METHOD_NAME ); try { identifierMethod = enumClass.getMethod( identifierMethodName, new Class[0] ); identifierType = identifierMethod.getReturnType(); } catch ( Exception e ) { throw new HibernateException( "Failed to obtain identifier method", e ); } type = ( NullableType ) TypeFactory.basic( identifierType.getName() ); if ( type == null ) throw new HibernateException( "Unsupported identifier type " + identifierType.getName() ); sqlTypes = new int[]{type.sqlType()}; String valueOfMethodName = parameters.getProperty( "valueOfMethod", DEFAULT_VALUE_OF_METHOD_NAME ); try { valueOfMethod = enumClass.getMethod( valueOfMethodName, new Class[]{identifierType} ); } catch ( Exception e ) { throw new HibernateException( "Failed to obtain valueOf method", e ); } }
public void setParameterValues( Properties parameters ) { String enumClassName = parameters.getProperty( "enumClass" ); try { enumClass = Class.forName( enumClassName ).asSubclass( Enum.class ); } catch ( ClassNotFoundException cfne ) { throw new HibernateException( "Enum class not found", cfne ); } String identifierMethodName = parameters.getProperty( "identifierMethod", DEFAULT_IDENTIFIER_METHOD_NAME ); try { identifierMethod = enumClass.getMethod( identifierMethodName, new Class[0] ); identifierType = identifierMethod.getReturnType(); } catch ( Exception e ) { throw new HibernateException( "Failed to obtain identifier method", e ); } type = ( NullableType ) TypeFactory.basic( identifierType.getName() ); if ( type == null ) throw new HibernateException( "Unsupported identifier type " + identifierType.getName() ); sqlTypes = new int[]{type.sqlType()}; String valueOfMethodName = parameters.getProperty( "valueOfMethod", DEFAULT_VALUE_OF_METHOD_NAME ); try { valueOfMethod = enumClass.getMethod( valueOfMethodName, new Class[]{identifierType} ); } catch ( Exception e ) { throw new HibernateException( "Failed to obtain valueOf method", e ); } }
public void setParameterValues(Properties parameters) { String enumClassName = parameters.getProperty("enumClass"); try { enumClass = Class.forName(enumClassName).asSubclass(Enum.class); } catch (ClassNotFoundException cfne) { throw new HibernateException("Enum class not found", cfne); } String identifierMethodName = parameters.getProperty("identifierMethod", DEFAULT_IDENTIFIER_METHOD_NAME); try { identifierMethod = enumClass.getMethod(identifierMethodName, new Class[0]); identifierType = identifierMethod.getReturnType(); } catch (Exception e) { throw new HibernateException("Failed to obtain identifier method", e); } type = (NullableType) TypeFactory.basic(identifierType.getName()); if (type == null) { throw new HibernateException("Unsupported identifier type " + identifierType.getName()); } sqlTypes = new int[] { type.sqlType() }; String valueOfMethodName = parameters.getProperty("valueOfMethod", DEFAULT_VALUE_OF_METHOD_NAME); try { valueOfMethod = enumClass.getMethod(valueOfMethodName, new Class[] { identifierType }); } catch (Exception e) { throw new HibernateException("Failed to obtain valueOf method", e); } }
type = (NullableType) TypeFactory.basic(identifierType.getName());
Type type = TypeFactory.basic( typeName ); if ( type == null ) { Class typeClass;
Type type = TypeFactory.basic( typeName ); if ( type == null ) { Class typeClass;