Ejemplo n.º 1
0
 public TypeSyntax Type <T>(Nullability nullability)
 {
     return((NullableEnable && !typeof(T).IsValueType && nullability != Nullability.NonNullable) ||
            (typeof(T).IsValueType && nullability == Nullability.NullableRefAndValue) ?
            NullableType(SyntaxHelpers.NonNullableType <T>()) :
            SyntaxHelpers.NonNullableType <T>());
 }
Ejemplo n.º 2
0
        public static Ejb3Column[] BuildColumnFromAnnotation(
            ColumnAttribute[] anns,
            FormulaAttribute formulaAnn, Nullability nullability, IPropertyHolder propertyHolder,
            IPropertyData inferredData,
            IDictionary <string, Join> secondaryTables,
            ExtendedMappings mappings)
        {
            Ejb3Column[] columns;

            if (formulaAnn != null)
            {
                Ejb3Column formulaColumn = new Ejb3Column();
                formulaColumn.SetFormula(formulaAnn.Value);
                formulaColumn.SetImplicit(false);
                formulaColumn.Mappings       = mappings;
                formulaColumn.PropertyHolder = propertyHolder;
                formulaColumn.Bind();
                columns = new Ejb3Column[] { formulaColumn };
            }
            else
            {
                columns = BuildColumnFromAnnotation(anns,
                                                    nullability,
                                                    propertyHolder,
                                                    inferredData,
                                                    secondaryTables,
                                                    mappings);
            }
            return(columns);
        }
Ejemplo n.º 3
0
        public ListColumn(IColumn <T> values, Nullability nullability = Nullability.DefaultToNull)
        {
            _indicesInner = new NumberListColumn <int>();
            _indices      = NullableColumn <NumberList <int> > .Wrap(_indicesInner, nullability);

            _values = values;
        }
Ejemplo n.º 4
0
        internal CustomViewType(Type customViewType) : base(customViewType, MetadataKinds.Struct)
        {
            try {
                BodyProperty =
                    customViewType.GetProperty("Body__", BindingFlags.NonPublic | BindingFlags.Instance) ??
                    customViewType.GetProperty("Body", BindingFlags.Public | BindingFlags.Instance);
                if (BodyProperty is null || !BodyProperty.CanRead || BodyProperty.CanWrite || !BodyProperty.PropertyType.IsSubclassOf(typeof(View)))
                {
                    throw new ArgumentException($"View implementations must either have a {nameof (SwiftImportAttribute)}, or declare a public, read-only `Body` property returning a concrete type of `{nameof (View)}`");
                }

                BodyNullability = Nullability.Of(BodyProperty);
                BodySwiftType   = SwiftType.Of(BodyProperty.PropertyType, BodyNullability) !;

                var thunkMetadata = (CustomViewMetadata *)fullMetadata;
                thunkMetadata->ThunkViewU = Metadata;
                thunkMetadata->ThunkViewT = BodySwiftType.Metadata;
                // Currently unused, so don't force allocation if it's a custom view
                //thunkMetadata->ThunkViewTViewConformance = swiftBodyType.ViewConformance;
                thunkMetadata->ThunkViewTViewConformance = null;

                // Proactively create View conformance. While generics that are explicitly constrained to View
                //  have the conformance passed in, other cases, such as TupleView, look up the conformance
                //  dynamically, so it's important to register it eagerly.
                ViewConformance = CreateViewConformance();
            } catch {
                // Ensure we don't leak allocated unmanaged memory
                Dispose(true);
                throw;
            }
        }
        public void MemberNullability(Nullability nullability, Type type, SchemaValueType valueType)
        {
            var config = new SchemaGeneratorConfiguration
            {
                Nullability = nullability
            };

            // Nullability affects root schema so only PropertiesKeywords are compared
            var expected = new JsonSchemaBuilder()
                           .Properties(
                (nameof(ReferenceMember.Property), new JsonSchemaBuilder().Type(valueType)))
                           .Build()
                           .Keywords
                           .OfType <PropertiesKeyword>()
                           .First();

            var actual = new JsonSchemaBuilder()
                         .FromType(type, config)
                         .Build()
                         .Keywords
                         .OfType <PropertiesKeyword>()
                         .First();

            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 6
0
        internal MetadataModule(ICompilation compilation, Metadata.PEFile peFile, TypeSystemOptions options)
        {
            this.Compilation  = compilation;
            this.PEFile       = peFile;
            this.metadata     = peFile.Metadata;
            this.options      = options;
            this.TypeProvider = new TypeProvider(this);

            // assembly metadata
            if (metadata.IsAssembly)
            {
                var asmdef = metadata.GetAssemblyDefinition();
                this.AssemblyName     = metadata.GetString(asmdef.Name);
                this.FullAssemblyName = metadata.GetFullAssemblyName();
            }
            else
            {
                var moddef = metadata.GetModuleDefinition();
                this.AssemblyName     = metadata.GetString(moddef.Name);
                this.FullAssemblyName = this.AssemblyName;
            }
            this.NullableContext = metadata.GetModuleDefinition().GetCustomAttributes().GetNullableContext(metadata) ?? Nullability.Oblivious;
            this.rootNamespace   = new MetadataNamespace(this, null, string.Empty, metadata.GetNamespaceDefinitionRoot());

            if (!options.HasFlag(TypeSystemOptions.Uncached))
            {
                // create arrays for resolved entities, indexed by row index
                this.typeDefs     = new MetadataTypeDefinition[metadata.TypeDefinitions.Count + 1];
                this.fieldDefs    = new MetadataField[metadata.FieldDefinitions.Count + 1];
                this.methodDefs   = new MetadataMethod[metadata.MethodDefinitions.Count + 1];
                this.propertyDefs = new MetadataProperty[metadata.PropertyDefinitions.Count + 1];
                this.eventDefs    = new MetadataEvent[metadata.EventDefinitions.Count + 1];
            }
        }
Ejemplo n.º 7
0
        private static (Nullability, IList <CustomAttributeTypedArgument>?) GetMemberNullability(MemberInfo member)
        {
            Nullability nullableContext = GetMethodDefaultNullability(member);

            foreach (var attribute in member.CustomAttributes)
            {
                if (attribute.AttributeType.FullName == "System.Runtime.CompilerServices.NullableAttribute" && attribute.ConstructorArguments.Count == 1)
                {
                    var argType = attribute.ConstructorArguments[0].ArgumentType;
                    if (argType == typeof(byte))
                    {
                        return((Nullability)(byte)attribute.ConstructorArguments[0].Value, null);
                    }
                    else if (argType == typeof(byte[]))
                    {
                        return(nullableContext, (IList <CustomAttributeTypedArgument>)attribute.ConstructorArguments[0].Value);
                    }
                    else
                    {
                        throw new NullabilityInterpretationException(member);
                    }
                }
            }
            return(nullableContext, null);
        }
Ejemplo n.º 8
0
 public override int GetHashCode()
 {
     return
         (Type.GetHashCode() +
          Name.GetHashCode() +
          IsPrimaryKey.GetHashCode() +
          Nullability.GetHashCode());
 }
Ejemplo n.º 9
0
 static bool getNullableValue(Nullability nullability, Type propertyType)
 {
     return(nullability switch
     {
         Nullability.Nullable => true,
         Nullability.NonNullable => false,
         Nullability.NotDefined => !propertyType.IsValueType || Nullable.GetUnderlyingType(propertyType) is not null,
         _ => false
     });
Ejemplo n.º 10
0
 internal NullabilityAnnotatedType(IType type, Nullability nullability)
     : base(type)
 {
     Debug.Assert(nullability != type.Nullability);
     // Due to IType -> concrete type casts all over the type system, we can insert
     // the NullabilityAnnotatedType wrapper only in some limited places.
     Debug.Assert(type is ITypeDefinition ||
                  (type is ITypeParameter && this is ITypeParameter));
     this.nullability = nullability;
 }
Ejemplo n.º 11
0
 public override IType ChangeNullability(Nullability nullability)
 {
     if (nullability == base.Nullability)
     {
         return(this);
     }
     else
     {
         return(new NullabilityAnnotatedType(this, nullability));
     }
 }
Ejemplo n.º 12
0
        public DictionaryColumn(IColumn <TKey> keys, IColumn <TValue> values, Nullability nullability = Nullability.DefaultToNull)
        {
            _keys       = keys;
            _values     = values;
            _pairsInner = new NumberListColumn <int>();
            _pairs      = NullableColumn <NumberList <int> > .Wrap(_pairsInner, nullability);

            // Comparer for sorting Dictionary Keys, picked up by ColumnDictionary.
            // Comparer not exposed as argument because column won't work if serialized Dictionaries were sorted differently than comparer would sort.
            _keyComparer = (typeof(TKey) == typeof(string) ? (IComparer <TKey>)StringComparer.Ordinal : new DefaultComparer <TKey>());
        }
Ejemplo n.º 13
0
        TypeSyntax MaybeNullableValueType(TypeSyntax typeSyntax, Nullability nullability)
        {
            switch (nullability)
            {
            case Nullability.NullableRefAndValue:
                return(NullableType(typeSyntax));

            default:
                return(typeSyntax);
            }
        }
Ejemplo n.º 14
0
 public IType ChangeNullability(Nullability nullability)
 {
     if (nullability == Nullability.Oblivious)
     {
         return(this);
     }
     else
     {
         return(new NullabilityAnnotatedType(this, nullability));
     }
 }
Ejemplo n.º 15
0
 public IType ChangeNullability(Nullability nullability)
 {
     if (nullability == NullabilityConstraint)
     {
         return(this);
     }
     else
     {
         return(new NullabilityAnnotatedTypeParameter(this, nullability));
     }
 }
Ejemplo n.º 16
0
 public IType ChangeNullability(Nullability nullability)
 {
     if (nullability == this.Nullability)
     {
         return(this);
     }
     else
     {
         return(new ICSharpCode.Decompiler.TypeSystem.Implementation.NullabilityAnnotatedType(this, nullability));
     }
 }
Ejemplo n.º 17
0
 public override IType ChangeNullability(Nullability nullability)
 {
     if (nullability == this.nullability)
     {
         return(this);
     }
     else
     {
         return(new ArrayType(compilation, elementType, dimensions, nullability));
     }
 }
Ejemplo n.º 18
0
 public override IType ChangeNullability(Nullability nullability)
 {
     if (nullability == this.nullability)
     {
         return(this);
     }
     else
     {
         return(baseType.ChangeNullability(nullability));
     }
 }
Ejemplo n.º 19
0
 private TypeName(ILocation location, TypeName original)
     : this(location)
 {
     value = original.value;
     templateParameters.AddRange(original.templateParameters);
     isFunction = original.isFunction;
     returnType = original.returnType;
     parameters.AddRange(original.parameters);
     nullability  = original.nullability;
     hasNamespace = original.hasNamespace;
 }
Ejemplo n.º 20
0
 public override IType ChangeNullability(Nullability nullability)
 {
     if (nullability == Nullability.Oblivious)
     {
         return(this);
     }
     else
     {
         return(new NullabilityAnnotatedTypeParameter(this, nullability));
     }
 }
Ejemplo n.º 21
0
        internal MetadataModule(ICompilation compilation, Metadata.PEFile peFile, TypeSystemOptions options)
        {
            this.Compilation  = compilation;
            this.PEFile       = peFile;
            this.metadata     = peFile.Metadata;
            this.options      = options;
            this.TypeProvider = new TypeProvider(this);

            // assembly metadata
            if (metadata.IsAssembly)
            {
                var asmdef = metadata.GetAssemblyDefinition();
                try
                {
                    this.AssemblyName     = metadata.GetString(asmdef.Name);
                    this.AssemblyVersion  = asmdef.Version;
                    this.FullAssemblyName = metadata.GetFullAssemblyName();
                }
                catch (BadImageFormatException)
                {
                    this.AssemblyName     = "<ERR: invalid assembly name>";
                    this.FullAssemblyName = "<ERR: invalid assembly name>";
                }
            }
            else
            {
                try
                {
                    var moddef = metadata.GetModuleDefinition();
                    this.AssemblyName = metadata.GetString(moddef.Name);
                }
                catch (BadImageFormatException)
                {
                    this.AssemblyName = "<ERR: invalid assembly name>";
                }
                this.FullAssemblyName = this.AssemblyName;
            }
            var customAttrs = metadata.GetModuleDefinition().GetCustomAttributes();

            this.NullableContext        = customAttrs.GetNullableContext(metadata) ?? Nullability.Oblivious;
            this.minAccessibilityForNRT = FindMinimumAccessibilityForNRT(metadata, customAttrs);
            this.rootNamespace          = new MetadataNamespace(this, null, string.Empty, metadata.GetNamespaceDefinitionRoot());

            if (!options.HasFlag(TypeSystemOptions.Uncached))
            {
                // create arrays for resolved entities, indexed by row index
                this.typeDefs             = new MetadataTypeDefinition[metadata.TypeDefinitions.Count + 1];
                this.fieldDefs            = new MetadataField[metadata.FieldDefinitions.Count + 1];
                this.methodDefs           = new MetadataMethod[metadata.MethodDefinitions.Count + 1];
                this.propertyDefs         = new MetadataProperty[metadata.PropertyDefinitions.Count + 1];
                this.eventDefs            = new MetadataEvent[metadata.EventDefinitions.Count + 1];
                this.referencedAssemblies = new IModule[metadata.AssemblyReferences.Count + 1];
            }
        }
Ejemplo n.º 22
0
        public override IType ChangeNullability(Nullability nullability)
        {
            IType newElementType = elementType.ChangeNullability(nullability);

            if (newElementType == elementType)
            {
                return(this);
            }
            else
            {
                return(new ModifiedType(modifier, newElementType, kind == TypeKind.ModReq));
            }
        }
Ejemplo n.º 23
0
        public IType ChangeNullability(Nullability nullability)
        {
            IType newGenericType = genericType.ChangeNullability(nullability);

            if (newGenericType == genericType)
            {
                return(this);
            }
            else
            {
                return(new ParameterizedType(newGenericType, typeArguments));
            }
        }
Ejemplo n.º 24
0
 public DefaultTypeParameter(
     IEntity owner,
     int index, string name                = null,
     VarianceModifier variance             = VarianceModifier.Invariant,
     IReadOnlyList <IAttribute> attributes = null,
     bool hasValueTypeConstraint           = false, bool hasReferenceTypeConstraint  = false, bool hasDefaultConstructorConstraint = false,
     IReadOnlyList <IType> constraints     = null, Nullability nullabilityConstraint = Nullability.Oblivious)
     : base(owner, index, name, variance)
 {
     this.hasValueTypeConstraint          = hasValueTypeConstraint;
     this.hasReferenceTypeConstraint      = hasReferenceTypeConstraint;
     this.hasDefaultConstructorConstraint = hasDefaultConstructorConstraint;
     this.nullabilityConstraint           = nullabilityConstraint;
     this.constraints = constraints ?? EmptyList <IType> .Instance;
     this.attributes  = attributes ?? EmptyList <IAttribute> .Instance;
 }
Ejemplo n.º 25
0
 public DefaultTypeParameter(
     ICompilation compilation, SymbolKind ownerType,
     int index, string name                = null,
     VarianceModifier variance             = VarianceModifier.Invariant,
     IReadOnlyList <IAttribute> attributes = null,
     bool hasValueTypeConstraint           = false, bool hasReferenceTypeConstraint  = false, bool hasDefaultConstructorConstraint = false,
     IReadOnlyList <IType> constraints     = null, Nullability nullabilityConstraint = Nullability.Oblivious)
     : base(compilation, ownerType, index, name, variance)
 {
     this.hasValueTypeConstraint          = hasValueTypeConstraint;
     this.hasReferenceTypeConstraint      = hasReferenceTypeConstraint;
     this.hasDefaultConstructorConstraint = hasDefaultConstructorConstraint;
     this.nullabilityConstraint           = nullabilityConstraint;
     this.TypeConstraints = MakeConstraints(constraints);
     this.attributes      = attributes ?? EmptyList <IAttribute> .Instance;
 }
        public void TypeNullability(Nullability nullability, Type type, SchemaValueType valueType)
        {
            var config = new SchemaGeneratorConfiguration
            {
                Nullability = nullability
            };

            var expected = new JsonSchemaBuilder()
                           .Type(valueType)
                           .Build();

            var actual = new JsonSchemaBuilder()
                         .FromType(type, config)
                         .Build();

            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 27
0
        public static IColumn <T> Wrap(IColumn <T> values, Nullability nullability)
        {
            switch (nullability)
            {
            case Nullability.DefaultToNull:
                return(new NullableColumn <T>(values, nullByDefault: true));

            case Nullability.DefaultToEmpty:
                return(new NullableColumn <T>(values, nullByDefault: false));

            case Nullability.NullsDisallowed:
                return(values);

            default:
                throw new NotImplementedException();
            }
        }
Ejemplo n.º 28
0
        TypeSyntax MaybeNullableRefType(TypeSyntax typeSyntax, Nullability nullability)
        {
            if (!NullableEnable)
            {
                return(typeSyntax);
            }

            switch (nullability)
            {
            case Nullability.NullableRef:
            case Nullability.NullableRefAndValue:
                return(NullableType(typeSyntax));

            default:
                return(typeSyntax);
            }
        }
Ejemplo n.º 29
0
        private static Nullability GetNullability(ParameterInfo parameter, Nullability defaultNullability)
        {
            if (parameter.ParameterType.GetTypeInfo().IsValueType)
            {
                return(Nullability.NotNull);
            }

            var nullableAttribute = parameter.CustomAttributes
                                    .FirstOrDefault(a => a.AttributeType.FullName == "System.Runtime.CompilerServices.NullableAttribute");

            if (nullableAttribute is null)
            {
                return(defaultNullability);
            }

            // Probably shouldn't happen
            if (nullableAttribute.ConstructorArguments.Count == 0)
            {
                return(Nullability.Nullable);
            }

            var firstArgument = nullableAttribute.ConstructorArguments.First();

            if (firstArgument.ArgumentType == typeof(byte))
            {
                var value = (byte)firstArgument.Value;
                return((Nullability)value);
            }
            else
            {
                var arguments = (ReadOnlyCollection <CustomAttributeTypedArgument>)firstArgument.Value;

                // Probably shouldn't happen
                if (arguments.Count == 0)
                {
                    return(defaultNullability);
                }

                var arg   = arguments[0];
                var value = (byte)arg.Value;

                return((Nullability)value);
            }
        }
Ejemplo n.º 30
0
        /// <summary>
        /// Returns a <see cref="SwiftHandle"/> bridging the given object to Swift.
        /// </summary>
        /// <remarks>
        /// The returned <see cref="SwiftHandle"/> must be disposed when no longer needed.
        /// </remarks>
        /// <param name="obj">The managed object to bridge to Swift</param>
        /// <param name="nullability">Determines whether to bridge the value to Swift
        ///  as an Optional value. If <typeparamref name="T"/> is identified as a known
        ///  nullable wrapper, such as <see cref="Nullable"/>, then the value is bridged
        ///  as an Optional regardless of the value of this parameter.</param>
        /// <exception cref="ArgumentNullException">Thrown when <paramref name="obj"/> is
        ///	 <c>null</c>, <typeparamref name="T"/> is not a known nullable wrapper type,
        ///	 and <paramref name="nullability"/> returns <c>false</c> from <see cref="Nullability.IsNullable"/>.</exception>
        /// <exception cref="ArgumentException">Thrown when the type <typeparamref name="T"/> cannot
        ///  be directly bridged to Swift</exception>
        public static unsafe SwiftHandle GetSwiftHandle <T> (this T obj, Nullability nullability = default)
        {
            var type      = typeof(T);
            var swiftType = SwiftType.Of(type, nullability);

            if (swiftType == null && obj != null)
            {
                type      = obj.GetType();
                swiftType = SwiftType.Of(type, nullability);
            }
            if (swiftType == null)
            {
                throw new ArgumentException($"Type '{type}' cannot be bridged to Swift");
            }

            // Nullable types are bridged to Swift optionals
            if (nullability.IsNullable || Nullability.IsReifiedNullable(type))
            {
                if (Nullability.IsNull(obj))
                {
                    var underlyingType      = Nullability.GetUnderlyingType(type);
                    var underlyingSwiftType = SwiftType.Of(underlyingType, nullability.Strip()) !;
                    return(Optional.Wrap(null, swiftType, underlyingSwiftType));
                }
                else
                {
                    var unwrapped = Nullability.Unwrap(obj);
                    using (var unwrappedHandle = unwrapped.GetSwiftHandle(nullability.Strip()))
                        return(Optional.Wrap(unwrappedHandle.Pointer, swiftType, unwrappedHandle.SwiftType));
                }
            }
            else if (obj is null)
            {
                throw new ArgumentNullException(nameof(obj));
            }

            return(obj switch {
                ISwiftValue swiftValue => swiftValue.GetSwiftHandle(),
                string val => new SwiftHandle(new Swift.String(val), swiftType, destroyOnDispose: true),
                _ when type.IsPrimitive => new SwiftHandle(obj, swiftType),
                _ => throw new NotImplementedException(type.ToString())
            });
Ejemplo n.º 31
0
        public static Ejb3Column[] BuildColumnFromAnnotation(
            ColumnAttribute[] anns,
            FormulaAttribute formulaAnn, Nullability nullability, IPropertyHolder propertyHolder,
            IPropertyData inferredData,
            IDictionary<string, Join> secondaryTables,
            ExtendedMappings mappings)
        {
            Ejb3Column[] columns;

            if (formulaAnn != null)
            {
                Ejb3Column formulaColumn = new Ejb3Column();
                formulaColumn.SetFormula(formulaAnn.Value);
                formulaColumn.SetImplicit(false);
                formulaColumn.Mappings = mappings;
                formulaColumn.PropertyHolder = propertyHolder;
                formulaColumn.Bind();
                columns = new Ejb3Column[] {formulaColumn};
            }
            else
            {
                columns = BuildColumnFromAnnotation(anns,
                                                    nullability,
                                                    propertyHolder,
                                                    inferredData,
                                                    secondaryTables,
                                                    mappings);
            }
            return columns;
        }
Ejemplo n.º 32
0
        private static Ejb3Column[] BuildColumnFromAnnotation(ColumnAttribute[] anns, Nullability nullability,
                                                              IPropertyHolder propertyHolder, IPropertyData inferredData,
                                                              IDictionary<string, Join> secondaryTables,
                                                              ExtendedMappings mappings)
        {
            ColumnAttribute[] actualCols = anns;
            ColumnAttribute[] overriddenCols = propertyHolder.GetOverriddenColumn(StringHelper.Qualify(propertyHolder.Path, inferredData.PropertyName));

            if (overriddenCols != null)
            {
                //check for overridden first
                if (anns != null && overriddenCols.Length != anns.Length)
                    throw new AnnotationException("AttributeOverride.column() should override all columns for now");

                actualCols = overriddenCols.Length == 0 ? null : overriddenCols;
                log.DebugFormat("Column(s) overridden for property {0}", inferredData.PropertyName);
            }

            if (actualCols == null)
                return BuildImplicitColumn(inferredData, secondaryTables, propertyHolder, nullability, mappings);

            int length = actualCols.Length;
            Ejb3Column[] columns = new Ejb3Column[length];
            for (int index = 0; index < length; index++)
            {
                ColumnAttribute col = actualCols[index];
                String sqlType = col.ColumnDefinition.Equals("") ? null : col.ColumnDefinition;
                Ejb3Column column = new Ejb3Column();
                column.SetImplicit(false);
                column.SetSqlType(sqlType);
                column.SetLength(col.Length);
                column.SetPrecision(col.Precision);
                column.SetScale(col.Scale);
                column.SetLogicalColumnName(col.Name);
                column.PropertyName = BinderHelper.GetRelativePath(propertyHolder, inferredData.PropertyName);
                column.SetNullable(col.Nullable); //TODO force to not null if available? This is a (bad) user choice.
                column.SetUnique(col.Unique);
                column.SetInsertable(col.Insertable);
                column.SetUpdatable(col.Updatable);
                column.SetSecondaryTableName(col.Table);
                column.PropertyHolder = propertyHolder;
                column.SetJoins(secondaryTables);
                column.Mappings = mappings;
                column.Bind();
                columns[index] = column;
            }
            return columns;
        }
Ejemplo n.º 33
0
 private static Ejb3Column[] BuildImplicitColumn(IPropertyData inferredData,
                                                 IDictionary<string, Join> secondaryTables,
                                                 IPropertyHolder propertyHolder, Nullability nullability,
                                                 ExtendedMappings mappings)
 {
     Ejb3Column[] columns;
     columns = new Ejb3Column[1];
     Ejb3Column column = new Ejb3Column();
     column.SetImplicit(false);
     //not following the spec but more clean
     if (nullability != Nullability.ForcedNull  && inferredData.ClassOrElement.IsPrimitive
             && !inferredData.Property.GetType().IsArray ) //TODO: IsArray in this way ???
     {
         column.SetNullable(false);
     }
     column.SetLength(DEFAULT_COLUMN_LENGTH);
     column.PropertyName = BinderHelper.GetRelativePath(propertyHolder, inferredData.PropertyName);
     column.PropertyHolder = propertyHolder;
     column.SetJoins(secondaryTables);
     column.Mappings = mappings;
     column.Bind();
     columns[0] = column;
     return columns;
 }