Пример #1
0
        /// <summary>
        /// Applies Foriegn key based on type.
        /// </summary>
        /// <param name="instance">The instance.</param>
        public void Apply(IComponentInstance instance)
        {
            var entityType = instance.EntityType;

            if (!entityType.IsNHibernateComponent())
            {
                var mapping = instance.ConvertToIComponentMapping();

                CreateForeignKeys(mapping, entityType);
            }
        }
Пример #2
0
        /// <summary>
        /// Creates Foreign Key indexes for components.
        /// </summary>
        /// <param name="instance">The instance.</param>
        public void Apply( IComponentInstance instance )
        {
            var entityType = instance.EntityType;

            if ( !entityType.IsNHibernateComponent () )
            {
                var mapping = instance.ConvertToIComponentMapping ();

                CreateForeignKeyIndexes ( mapping, entityType );
            }
        }
Пример #3
0
        /// <summary>
        /// Applies nullablity based on type.
        /// </summary>
        /// <param name="instance">The instance.</param>
        public void Apply(IComponentInstance instance)
        {
            var entityType = instance.EntityType;

            if (!entityType.IsNHibernateComponent())
            {
                var rootComponentMember = instance.Property;
                if (!rootComponentMember.IsDbNullable())
                {
                    var mapping = instance.ConvertToIComponentMapping();
                    ProcessSettingNotNullable(mapping);
                }
            }
        }
Пример #4
0
        /// <summary>
        /// Applies nullablity based on type.
        /// </summary>
        /// <param name="instance">The instance.</param>
        public void Apply( IComponentInstance instance )
        {
            var entityType = instance.EntityType;

            if ( !entityType.IsNHibernateComponent () )
            {
                var rootComponentMember = instance.Property;
                if ( !rootComponentMember.IsDbNullable () )
                {
                    var mapping = instance.ConvertToIComponentMapping ();
                    ProcessSettingNotNullable ( mapping );
                }
            }
        }