public virtual void OnModelChanged(Net.Vpc.Upa.Callbacks.PersistenceUnitEvent @event) { Net.Vpc.Upa.Types.DataType dataType = field.GetDataType(); if (dataType is Net.Vpc.Upa.Impl.SerializableOrManyToOneType) { Net.Vpc.Upa.Impl.SerializableOrManyToOneType masterDatatype = (Net.Vpc.Upa.Impl.SerializableOrManyToOneType)dataType; System.Type tt = masterDatatype.GetEntityType(); if (Net.Vpc.Upa.Impl.Util.PlatformUtils.IsSerializable(tt)) { field.SetDataType(new Net.Vpc.Upa.Types.SerializableType(masterDatatype.GetName(), tt, masterDatatype.IsNullable())); field.SetTypeTransform(null); } else { throw new System.ArgumentException("Type " + tt + " is neither Entity nor Serializable for " + field); } } }
public virtual void Process() { Net.Vpc.Upa.Types.DataType dataType = field.GetDataType(); if (dataType is Net.Vpc.Upa.Impl.SerializableOrManyToOneType) { Net.Vpc.Upa.Impl.SerializableOrManyToOneType master = (Net.Vpc.Upa.Impl.SerializableOrManyToOneType)dataType; relationshipTargetEntityType = master.GetEntityType(); if (persistenceUnit.ContainsEntity(relationshipTargetEntityType)) { Net.Vpc.Upa.Entity tt = persistenceUnit.GetEntity(relationshipTargetEntityType); BindRelation(tt); } else { persistenceUnit.AddDefinitionListener(relationshipTargetEntityType, this, true); persistenceUnit.AddPersistenceUnitListener(this); } } }