示例#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;
        }
示例#3
0
		private IType BuildType()
		{
			// TODO : temporary initial step towards HHH-1907
			ComponentMetamodel metamodel = new ComponentMetamodel(this);
			// TODO NH : The proble to mange correctly EmbeddedComponentType is in binders (NH-1405)
			//if (IsEmbedded)
			//{
			//  return new EmbeddedComponentType(metamodel);
			//}
			//else
			//{
				return new ComponentType(metamodel);
			//}
		}
示例#4
0
		private IType BuildType()
		{
			// TODO : temporary initial step towards HHH-1907
			ComponentMetamodel metamodel = new ComponentMetamodel(this);
			if (IsEmbedded)
			{
				return new EmbeddedComponentType(metamodel);
			}
			else
			{
				return new ComponentType(metamodel);
			}
		}
		public EmbeddedComponentType(ComponentMetamodel metamodel)
			: base(metamodel)
		{
		}