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; } ComponentTuplizer = metamodel.ComponentTuplizer; EntityMode = metamodel.EntityMode; if (EntityMode == EntityMode.Poco) { overridesGetHashCode = ReflectHelper.OverridesGetHashCode(ComponentTuplizer.MappedClass); } }
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 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; }
public EmbeddedComponentType(ComponentMetamodel metamodel) : base(metamodel) { }