public CustomCollectionType(Class userTypeClass, String role, String foreignKeyPropertyName, boolean isEmbeddedInXML) { super(role, foreignKeyPropertyName, isEmbeddedInXML); if ( !UserCollectionType.class.isAssignableFrom( userTypeClass ) ) { throw new MappingException( "Custom type does not implement UserCollectionType: " + userTypeClass.getName() ); } try { userType = ( UserCollectionType ) userTypeClass.newInstance(); } catch ( InstantiationException ie ) { throw new MappingException( "Cannot instantiate custom type: " + userTypeClass.getName() ); } catch ( IllegalAccessException iae ) { throw new MappingException( "IllegalAccessException trying to instantiate custom type: " + userTypeClass.getName() ); } customLogging = LoggableUserType.class.isAssignableFrom( userTypeClass ); }
private static UserCollectionType createUserCollectionType(Class userTypeClass) { if ( !UserCollectionType.class.isAssignableFrom( userTypeClass ) ) { throw new MappingException( "Custom type does not implement UserCollectionType: " + userTypeClass.getName() ); } try { return ( UserCollectionType ) userTypeClass.newInstance(); } catch ( InstantiationException ie ) { throw new MappingException( "Cannot instantiate custom type: " + userTypeClass.getName() ); } catch ( IllegalAccessException iae ) { throw new MappingException( "IllegalAccessException trying to instantiate custom type: " + userTypeClass.getName() ); } }
public UserCollectionType getUserType() { return userType; }