예제 #1
0
        public ComponentType(ComponentMetamodel metamodel)
        {
            // for now, just "re-flatten" the metamodel since this is temporary stuff anyway (HHH-1907)
            isKey               = metamodel.IsKey;
            propertySpan        = metamodel.PropertySpan;
            propertyNames       = new string[propertySpan];
            propertyTypes       = new IType[propertySpan];
            propertyNullability = new bool[propertySpan];
            cascade             = new CascadeStyle[propertySpan];
            joinedFetch         = new FetchMode?[propertySpan];

            for (int i = 0; i < propertySpan; i++)
            {
                StandardProperty prop = metamodel.GetProperty(i);
                propertyNames[i]       = prop.Name;
                propertyTypes[i]       = prop.Type;
                propertyNullability[i] = prop.IsNullable;
                cascade[i]             = prop.CascadeStyle;
                joinedFetch[i]         = prop.FetchMode;
            }

            tuplizerMapping = metamodel.TuplizerMapping;
            var tuplizer = tuplizerMapping.GetTuplizerOrNull(EntityMode.Poco);

            if (tuplizer != null)
            {
                overridesGetHashCode = ReflectHelper.OverridesGetHashCode(tuplizer.MappedClass);
            }
        }
예제 #2
0
        public ComponentType(ComponentMetamodel metamodel)
        {
            // for now, just "re-flatten" the metamodel since this is temporary stuff anyway (HHH-1907)
            isKey               = metamodel.IsKey;
            propertySpan        = metamodel.PropertySpan;
            propertyNames       = new string[propertySpan];
            propertyTypes       = new IType[propertySpan];
            propertyNullability = new bool[propertySpan];
            cascade             = new CascadeStyle[propertySpan];
            joinedFetch         = new FetchMode?[propertySpan];

            for (int i = 0; i < propertySpan; i++)
            {
                StandardProperty prop = metamodel.GetProperty(i);
                propertyNames[i]       = prop.Name;
                propertyTypes[i]       = prop.Type;
                propertyNullability[i] = prop.IsNullable;
                cascade[i]             = prop.CascadeStyle;
                joinedFetch[i]         = prop.FetchMode;
            }

            tuplizerMapping = metamodel.TuplizerMapping;
        }