protected virtual bool IsRealNullable(Property p) { var cls = p.ObjectClass as ObjectClass; if(cls == null) { return p.IsNullable(); } else { // Has to be nullalbe when not the base class in TPH hierarchies return (cls.GetTableMapping() == TableMapping.TPH && cls.BaseObjectClass != null) || p.IsNullable(); } }
public NotifyingDataProperty(Arebis.CodeGeneration.IGenerationHost _host, IZetboxContext ctx, Serialization.SerializationMembersList serializationList, Property prop) : this(_host, ctx, serializationList, prop.GetElementTypeString(), prop.Name, prop.Module.Namespace, "_" + prop.Name, prop.IsCalculated(), prop.DisableExport == true, prop.ObjectClass.Name, prop.IsNullable(), prop.DefaultValue != null && !prop.IsCalculated(), // No default value for calculated properties, default values are used then for database migration prop.ExportGuid) { }
internal static void DecorateElementType(Property obj, MethodReturnEventArgs<string> e, bool isStruct) { if (obj == null) throw new ArgumentNullException("obj"); if (e == null) throw new ArgumentNullException("e"); if (isStruct && obj.IsNullable()) { e.Result += "?"; } }
protected override void ApplyNotifyingValueProperty( Property prop, Templates.Serialization.SerializationMembersList serList) { Properties.ProxyProperty.Call(Host, ctx, serList, prop.Module.Namespace, prop.GetElementTypeString(), prop.Name, false, true, prop.DefaultValue != null, prop.ObjectClass.GetDataTypeString(), prop.GetClassName(), prop.IsNullable(), "_is" + prop.Name + "Set", prop.ExportGuid, prop.GetElementTypeString(), "Proxy." + prop.Name, prop.IsCalculated(), prop.DisableExport == true); }