private static IAuxiliaryDatabaseObject CreateCustomObject(Mappings mappings, HbmDatabaseObject databaseObjectSchema)
        {
            HbmDefinition definitionSchema = databaseObjectSchema.FindDefinition();
            string        customTypeName   = definitionSchema.@class;

            try
            {
                string className =
                    TypeNameParser.Parse(customTypeName, mappings.DefaultNamespace, mappings.DefaultAssembly).ToString();
                System.Type customType = ReflectHelper.ClassForName(className);

                IAuxiliaryDatabaseObject customObject =
                    (IAuxiliaryDatabaseObject)Environment.BytecodeProvider.ObjectsFactory.CreateInstance(customType);

                foreach (string dialectName in databaseObjectSchema.FindDialectScopeNames())
                {
                    customObject.AddDialectScope(dialectName);
                }

                customObject.SetParameterValues(definitionSchema.FindParameterValues());

                return(customObject);
            }
            catch (TypeLoadException exception)
            {
                throw new MappingException(string.Format("Could not locate custom database object class [{0}].", customTypeName),
                                           exception);
            }
            catch (Exception exception)
            {
                throw new MappingException(
                          string.Format("Could not instantiate custom database object class [{0}].", customTypeName), exception);
            }
        }