protected override void ApplyCompoundObjectPropertyTemplate(CompoundObjectProperty prop) { this.WriteLine(" // CompoundObject property"); Templates.Properties.CompoundObjectPropertyTemplate.Call(Host, ctx, this.MembersToSerialize, prop); }
protected override void ApplyCompoundObjectListTemplate(CompoundObjectProperty prop) { this.WriteLine(" // CompoundObject list property"); Properties.ValueCollectionProperty.Call(Host, ctx, this.MembersToSerialize, prop); }
protected override void ApplyCompoundObjectPropertyTemplate(CompoundObjectProperty prop) { this.WriteLine(" // CompoundObject property"); Templates.Properties.CompoundObjectPropertyTemplate.Call(Host, ctx, this.MembersToSerialize, prop); }
public static void GetPropertyType(CompoundObjectProperty obj, MethodReturnEventArgs <Type> e) { var def = obj.CompoundObjectDefinition; e.Result = Type.GetType(def.Module.Namespace + "." + def.Name, true); PropertyActions.DecorateParameterType(obj, e, false, obj.IsList, obj.HasPersistentOrder); }
protected override void ApplyCompoundObjectListTemplate(CompoundObjectProperty prop) { this.WriteLine(" // CompoundObject list property"); Properties.ValueCollectionProperty.Call(Host, ctx, this.MembersToSerialize, prop); }
public ModelMslEntityTypeMappingComplexProperty(Arebis.CodeGeneration.IGenerationHost _host, IZetboxContext ctx, CompoundObjectProperty prop, string propertyName, string parentName) : base(_host) { this.ctx = ctx; this.prop = prop; this.propertyName = propertyName; this.parentName = parentName; }
public ModelMslEntityTypeMappingComplexProperty(Arebis.CodeGeneration.IGenerationHost _host, IZetboxContext ctx, CompoundObjectProperty prop, string propertyName, string parentName) : base(_host) { this.ctx = ctx; this.prop = prop; this.propertyName = propertyName; this.parentName = parentName; }
public static void Call( Arebis.CodeGeneration.IGenerationHost _host, IZetboxContext ctx, string prefix, CompoundObjectProperty prop, string propName, string columnName, bool forceDefinition, string implementationSuffix) { if (_host == null) { throw new ArgumentNullException("_host"); } // shortcut unmapped properties //if (prop.IsCalculated) //{ // _host.WriteOutput(string.Format("<!-- CompoundObjectProperty {0} is calculated -->", prop.Name)); // return; //} propName = string.IsNullOrEmpty(propName) ? prop.Name : propName; columnName = string.IsNullOrEmpty(columnName) ? propName : columnName; string valueClassAttr = String.Format("class=\"{0}.{1}{2},Zetbox.Objects.NHibernateImpl\"", prop.CompoundObjectDefinition.Module.Namespace, prop.CompoundObjectDefinition.Name, implementationSuffix); string isNullColumnAttr = String.Format("column=\"`{0}`\"", columnName); string ceClassAttr; if (prop.IsList && !forceDefinition) { // set the proper type for collection entries ceClassAttr = String.Format("class=\"{0}.{1}{2}+{1}Proxy,Zetbox.Objects.NHibernateImpl\"", prop.GetCollectionEntryNamespace(), prop.GetCollectionEntryClassName(), implementationSuffix); } else { // not needed ceClassAttr = String.Empty; } string ceReverseKeyColumnName = prop.GetCollectionEntryReverseKeyColumnName(); Call(_host, ctx, prefix, propName, columnName, prop.IsList && !forceDefinition, ceClassAttr, valueClassAttr, isNullColumnAttr, ceReverseKeyColumnName, prop.CompoundObjectDefinition.Properties); }
public static void Call( Arebis.CodeGeneration.IGenerationHost _host, IZetboxContext ctx, string prefix, CompoundObjectProperty prop, string propName, string columnName, bool forceDefinition, string implementationSuffix) { if (_host == null) throw new ArgumentNullException("_host"); if (prop == null) throw new ArgumentNullException("prop"); if (prop.CompoundObjectDefinition == null) throw new ArgumentException("CompoundObjectProperty has no definition", "prop"); if (prop.CompoundObjectDefinition.Module == null) throw new ArgumentException("CompoundObjectProperty.CompoundObjectDefinition has no module", "prop"); // shortcut unmapped properties //if (prop.IsCalculated) //{ // _host.WriteOutput(string.Format("<!-- CompoundObjectProperty {0} is calculated -->", prop.Name)); // return; //} propName = string.IsNullOrEmpty(propName) ? prop.Name : propName; columnName = string.IsNullOrEmpty(columnName) ? Construct.ColumnName(prop, prefix) : prefix + columnName; string valueClassAttr = String.Format("class=\"{0}.{1}{2},Zetbox.Objects.NHibernateImpl\"", prop.CompoundObjectDefinition.Module.Namespace, prop.CompoundObjectDefinition.Name, implementationSuffix); string isNullColumnAttr = String.Format("column=\"`{0}`\"", columnName); string ceClassAttr; if (prop.IsList && !forceDefinition) { // set the proper type for collection entries ceClassAttr = String.Format("class=\"{0}.{1}{2}+{1}Proxy,Zetbox.Objects.NHibernateImpl\"", prop.GetCollectionEntryNamespace(), prop.GetCollectionEntryClassName(), implementationSuffix); } else { // not needed ceClassAttr = String.Empty; } string ceReverseKeyColumnName = Construct.ForeignKeyColumnName(prop); Call(_host, ctx, prefix, propName, columnName, prop.IsList && !forceDefinition, ceClassAttr, valueClassAttr, isNullColumnAttr, ceReverseKeyColumnName, prop.CompoundObjectDefinition.Properties); }
public static void postSet_CompoundObjectDefinition(CompoundObjectProperty obj, PropertyPostSetterEventArgs<CompoundObject> e) { var def = ViewModelDescriptors.Zetbox_Client_Presentables_ValueViewModels_CompoundObjectPropertyViewModel.Find(obj.Context); if (obj.ValueModelDescriptor == def && e.OldValue == null && e.NewValue != null && e.NewValue.DefaultPropertyViewModelDescriptor != null) { // Only once, during initialize obj.ValueModelDescriptor = e.NewValue.DefaultPropertyViewModelDescriptor; } }
public static void Call(IGenerationHost _host, IZetboxContext ctx, CompoundObjectProperty property, string implementationSuffix, string implementationPropertySuffix) { string propertyName = property.Name; string backingStoreName = propertyName + implementationPropertySuffix; string typeName = property.GetElementTypeString(); string implementationTypeName = typeName + implementationSuffix; Call(_host, ctx, implementationTypeName, propertyName, backingStoreName); }
protected virtual void ApplyEntityTypeColumnDefs(CompoundObjectProperty prop) { EfModel.ModelSsdlEntityTypeColumns.Call( Host, ctx, new Property[] { prop }, String.Empty, schemaProvider); }
public static void Call(IGenerationHost _host, IZetboxContext ctx, CompoundObjectProperty property, string implementationSuffix, string implementationPropertySuffix) { string propertyName = property.Name; string backingStoreName = propertyName + implementationPropertySuffix; string typeName = property.GetElementTypeString(); string implementationTypeName = typeName + implementationSuffix; Call(_host, ctx, implementationTypeName, propertyName, backingStoreName); }
public static void Call(IGenerationHost _host, IZetboxContext ctx, CompoundObjectProperty property, bool asCollectionEntry, string implementationSuffix, string implementationPropertySuffix, string lazyCtxProperty) { string propertyName = asCollectionEntry ? "Value" : property.Name; string backingStoreName = propertyName + implementationPropertySuffix; string typeName = property.GetElementTypeString(); string implementationTypeName = typeName + implementationSuffix; string lazyCtxParam = string.IsNullOrEmpty(lazyCtxProperty) ? "null" : lazyCtxProperty; Call(_host, ctx, implementationTypeName, propertyName, backingStoreName, lazyCtxParam); }
public static void postSet_CompoundObjectDefinition(CompoundObjectProperty obj, PropertyPostSetterEventArgs <CompoundObject> e) { var def = ViewModelDescriptors.Zetbox_Client_Presentables_ValueViewModels_CompoundObjectPropertyViewModel.Find(obj.Context); if (obj.ValueModelDescriptor == def && e.OldValue == null && e.NewValue != null && e.NewValue.DefaultPropertyViewModelDescriptor != null) { // Only once, during initialize obj.ValueModelDescriptor = e.NewValue.DefaultPropertyViewModelDescriptor; } }
public static void Call(Arebis.CodeGeneration.IGenerationHost host, IZetboxContext ctx, Serialization.SerializationMembersList serializationList, CompoundObjectProperty prop, string collectionWrapperClass, string listWrapperClass) { if (prop == null) throw new ArgumentNullException("prop"); Call(host, ctx, serializationList, prop, prop.HasPersistentOrder, prop.IsList, collectionWrapperClass, listWrapperClass); }
public static void Call( Arebis.CodeGeneration.IGenerationHost host, IZetboxContext ctx, Serialization.SerializationMembersList serializationList, CompoundObjectProperty prop) { if (host == null) { throw new ArgumentNullException("host"); } if (prop == null) { throw new ArgumentNullException("prop"); } string propName = prop.Name; Call(host, ctx, serializationList, prop, propName, prop.IsList, prop.HasPersistentOrder); }
public static void Call(Arebis.CodeGeneration.IGenerationHost host, IZetboxContext ctx, Serialization.SerializationMembersList serializationList, CompoundObjectProperty prop, string collectionWrapperClass, string listWrapperClass) { if (prop == null) { throw new ArgumentNullException("prop"); } Call(host, ctx, serializationList, prop, prop.HasPersistentOrder, prop.IsList, collectionWrapperClass, listWrapperClass); }
public static void Call(Arebis.CodeGeneration.IGenerationHost host, IZetboxContext ctx, Templates.Serialization.SerializationMembersList serializationList, CompoundObjectProperty prop) { if (prop == null) throw new ArgumentNullException("prop"); // CompoundObjects cannot be compared, therefore we have to avoid sorting the list here // although it would be required to keep the exported collection stable // TODO: implement a comparer for COs using a DefaultSortOrder property(-list) to re-enable this Call(host, ctx, serializationList, prop, prop.HasPersistentOrder, prop.IsList, false); }
public static void Call(Arebis.CodeGeneration.IGenerationHost host, IZetboxContext ctx, Templates.Serialization.SerializationMembersList serializationList, CompoundObjectProperty prop) { if (prop == null) { throw new ArgumentNullException("prop"); } // CompoundObjects cannot be compared, therefore we have to avoid sorting the list here // although it would be required to keep the exported collection stable // TODO: implement a comparer for COs using a DefaultSortOrder property(-list) to re-enable this Call(host, ctx, serializationList, prop, prop.HasPersistentOrder, prop.IsList, false); }
public static void GetElementTypeString(CompoundObjectProperty obj, MethodReturnEventArgs<string> e) { var def = obj.CompoundObjectDefinition; if (def == null) { e.Result = "<no type>"; } else if (def.Module == null) { e.Result = "<no namespace>." + def.Name; } else { e.Result = def.Module.Namespace + "." + def.Name; } PropertyActions.DecorateElementType(obj, e, false); }
public static void Call( Arebis.CodeGeneration.IGenerationHost host, IZetboxContext ctx, Serialization.SerializationMembersList serializationList, CompoundObjectProperty prop) { if (host == null) { throw new ArgumentNullException("host"); } if (prop == null) { throw new ArgumentNullException("prop"); } string propName = prop.Name; Call(host, ctx, serializationList, prop, propName, prop.IsList, prop.HasPersistentOrder); }
public static void GetElementTypeString(CompoundObjectProperty obj, MethodReturnEventArgs <string> e) { var def = obj.CompoundObjectDefinition; if (def == null) { e.Result = "<no type>"; } else if (def.Module == null) { e.Result = "<no namespace>." + def.Name; } else { e.Result = def.Module.Namespace + "." + def.Name; } PropertyActions.DecorateElementType(obj, e, false); }
public static void Call(Arebis.CodeGeneration.IGenerationHost host, IZetboxContext ctx, Serialization.SerializationMembersList serializationList, CompoundObjectProperty prop, string overridePropName, bool isList, bool hasPersistentOrder) { string xmlNamespace = prop.Module.Namespace; string backingPropertyName = overridePropName + Zetbox.API.Helper.ImplementationSuffix; string backingStoreName = "_" + overridePropName; string coType = prop.GetElementTypeString(); string coImplementationType = coType + host.Settings["extrasuffix"] + Zetbox.API.Helper.ImplementationSuffix; if (isList && hasPersistentOrder) { coType = string.Format("IList<{0}>", coType); coImplementationType = string.Format("IList<{0}>", coImplementationType); } else if (isList && !hasPersistentOrder) { coType = string.Format("ICollection<{0}>", coType); coImplementationType = string.Format("ICollection<{0}>", coImplementationType); } Call(host, ctx, serializationList, xmlNamespace, overridePropName, backingPropertyName, backingStoreName, coType, coImplementationType, prop.DisableExport == true); }
public static void GetPropertyType(CompoundObjectProperty obj, MethodReturnEventArgs<Type> e) { var def = obj.CompoundObjectDefinition; e.Result = Type.GetType(def.Module.Namespace + "." + def.Name, true); PropertyActions.DecorateParameterType(obj, e, false, obj.IsList, obj.HasPersistentOrder); }
protected virtual void ApplyCompoundObjectProperty(string prefix, CompoundObjectProperty prop) { CompoundObjectPropertyHbm.Call(Host, ctx, prefix, prop, null, null, false, ImplementationSuffix); }
private void CreateCompoundObjectProperty(TableRef tblName, CompoundObjectProperty cprop, string prefix, bool logAsNew) { string baseColName = Construct.ColumnName(cprop, prefix); if (logAsNew) Log.InfoFormat("New is null column for CompoundObject Property: '{0}'", cprop.Name); var hasData = db.CheckTableContainsData(tblName); foreach (var valProp in cprop.CompoundObjectDefinition.Properties.OfType<ValueTypeProperty>()) { var colName = Construct.ColumnName(valProp, baseColName); if (logAsNew) Log.InfoFormat("New nullable ValueType Property: '{0}' ('{1}')", valProp.Name, colName); CheckValueTypePropertyHasWarnings(valProp); db.CreateColumn( tblName, colName, valProp.GetDbType(), valProp.GetSize(), valProp.GetScale(), hasData || valProp.IsNullable(), null); // CP-Objects does not have a default value. could be nullable or deep in a TPH hierarchy } // TODO: Add nested CompoundObjectProperty }
public CompoundCollectionPropertyValueModel(INotifyingObject obj, CompoundObjectProperty prop) : base(obj, prop) { _property = prop; }
public static void Call(Arebis.CodeGeneration.IGenerationHost host, IZetboxContext ctx, CompoundObjectProperty prop) { if (host == null) { throw new ArgumentNullException("host"); } host.CallTemplate("CollectionEntries.ValueCollectionEntry", ctx, prop); }
public void DoNewCompoundObjectPropertyList(ObjectClass objClass, CompoundObjectProperty cprop) { Log.InfoFormat("New CompoundObject Property List: {0}", cprop.Name); var tblName = db.GetTableName(cprop.Module.SchemaName, cprop.GetCollectionEntryTable()); string fkName = "fk_" + cprop.ObjectClass.Name; // TODO: Support neested CompoundObject string valPropIndexName = cprop.Name + "Index"; string assocName = cprop.GetAssociationName(); bool hasPersistentOrder = cprop.HasPersistentOrder; db.CreateTable(tblName, true); db.CreateColumn(tblName, fkName, System.Data.DbType.Int32, 0, 0, false); foreach (ValueTypeProperty p in cprop.CompoundObjectDefinition.Properties) { db.CreateColumn(tblName, Construct.NestedColumnName(p.Name, cprop.Name), p.GetDbType(), p.GetSize(), p.GetScale(), true, SchemaManager.GetDefaultConstraint(cprop)); } if (hasPersistentOrder) { db.CreateColumn(tblName, valPropIndexName, System.Data.DbType.Int32, 0, 0, false); } db.CreateFKConstraint(tblName, db.GetTableName(objClass.Module.SchemaName, objClass.TableName), fkName, assocName, true); db.CreateIndex(tblName, Construct.IndexName(tblName.Name, fkName), false, false, fkName); }
public bool IsMoveCompoundObjectPropertyList(CompoundObjectProperty prop) { var saved = savedSchema.FindPersistenceObject<CompoundObjectProperty>(prop.ExportGuid); if (saved == null) return false; return saved.ObjectClass.ExportGuid != prop.ObjectClass.ExportGuid; }
protected override void ApplyCompoundObjectPropertyTemplate(CompoundObjectProperty prop) { base.ApplyCompoundObjectPropertyTemplate(prop); }
public bool IsNewCompoundObjectPropertyList(CompoundObjectProperty prop) { return savedSchema.FindPersistenceObject<Property>(prop.ExportGuid) == null; }
public static void Call(Arebis.CodeGeneration.IGenerationHost host, IZetboxContext ctx, Serialization.SerializationMembersList serializationList, CompoundObjectProperty prop, string overridePropName, bool isList, bool hasPersistentOrder) { string xmlNamespace = prop.Module.Namespace; string backingPropertyName = overridePropName + Zetbox.API.Helper.ImplementationSuffix; string backingStoreName = "_" + overridePropName; string coType = prop.GetElementTypeString(); string coImplementationType = coType + host.Settings["extrasuffix"] + Zetbox.API.Helper.ImplementationSuffix; if (isList && hasPersistentOrder) { coType = string.Format("IList<{0}>", coType); coImplementationType = string.Format("IList<{0}>", coImplementationType); } else if (isList && !hasPersistentOrder) { coType = string.Format("ICollection<{0}>", coType); coImplementationType = string.Format("ICollection<{0}>", coImplementationType); } Call(host, ctx, serializationList, xmlNamespace, overridePropName, backingPropertyName, backingStoreName, coType, coImplementationType, prop.DisableExport == true); }
public static string ListPositionColumnName(CompoundObjectProperty prop) { return(prop.Name + Zetbox.API.Helper.PositionSuffix); }
public static void Call(Arebis.CodeGeneration.IGenerationHost host, IZetboxContext ctx, CompoundObjectProperty prop) { if (host == null) { throw new ArgumentNullException("host"); } host.CallTemplate("CollectionEntries.ValueCollectionEntry", ctx, prop); }
public static void GetPropertyTypeString(CompoundObjectProperty obj, MethodReturnEventArgs<string> e) { GetElementTypeString(obj, e); PropertyActions.DecorateParameterType(obj, e, false, obj.IsList, obj.HasPersistentOrder); }
public static string ListPositionColumnName(CompoundObjectProperty prop) { return prop.Name + Zetbox.API.Helper.PositionSuffix; }
public void DoRenameCompoundObjectPropertyListName(ObjectClass objClass, CompoundObjectProperty prop) { var saved = savedSchema.FindPersistenceObject<CompoundObjectProperty>(prop.ExportGuid); Log.ErrorFormat("renaming a Property from '{0}' to '{1}' is not supported yet", saved.Name, prop.Name); }
public static string ListPositionColumnName(CompoundObjectProperty prop) { if (prop == null) throw new ArgumentNullException("prop"); return prop.Name + Zetbox.API.Helper.PositionSuffix; }
protected virtual void ApplyCompoundObjectListTemplate(CompoundObjectProperty prop) { this.WriteLine(" // CompoundObject list property"); ApplyListProperty(prop, this.MembersToSerialize); }
public static string ForeignKeyColumnName(CompoundObjectProperty listProp) { if (listProp == null) { throw new ArgumentNullException("listProp"); } return ForeignKeyColumnName(listProp.ObjectClass.Name); }
protected virtual void ApplyCompoundObjectProperty(string prefix, CompoundObjectProperty prop) { CompoundObjectPropertyHbm.Call(Host, ctx, prefix, prop, null, null, false, ImplementationSuffix); }
protected override void ApplyCompoundObjectPropertyTemplate(CompoundObjectProperty prop) { base.ApplyCompoundObjectPropertyTemplate(prop); }
public CompoundObjectPropertyValueModel(INotifyingObject obj, CompoundObjectProperty prop) : base(obj, prop) { this.cProp = prop; }
protected virtual void ApplyCompoundObjectPropertyTemplate(CompoundObjectProperty prop) { this.WriteLine(" // CompoundObject property"); ApplyNotifyingValueProperty(prop, this.MembersToSerialize); }
public void DoNewCompoundObjectProperty(ObjectClass objClass, CompoundObjectProperty cprop, string prefix) { string baseColName = Construct.NestedColumnName(cprop, prefix); Log.InfoFormat("New is null column for CompoundObject Property: '{0}'", cprop.Name); var tblName = db.GetTableName(objClass.Module.SchemaName, objClass.TableName); var hasData = db.CheckTableContainsData(tblName); foreach (var valProp in cprop.CompoundObjectDefinition.Properties.OfType<ValueTypeProperty>()) { var colName = Construct.NestedColumnName(valProp, baseColName); Log.InfoFormat("New nullable ValueType Property: '{0}' ('{1}')", valProp.Name, colName); db.CreateColumn( tblName, colName, valProp.GetDbType(), valProp.GetSize(), valProp.GetScale(), hasData || valProp.IsNullable(), SchemaManager.GetDefaultConstraint(valProp)); } // TODO: Add neested CompoundObjectProperty }
protected virtual void ApplyCompoundObjectPropertyTemplate(CompoundObjectProperty prop) { this.WriteLine(" // CompoundObject property"); ApplyNotifyingValueProperty(prop, this.MembersToSerialize); }
public bool IsDeleteCompoundObjectPropertyList(CompoundObjectProperty savedCProp) { return savedCProp.IsList && schema.FindPersistenceObject<CompoundObjectProperty>(savedCProp.ExportGuid) == null; }
public static void GetPropertyTypeString(CompoundObjectProperty obj, MethodReturnEventArgs <string> e) { GetElementTypeString(obj, e); PropertyActions.DecorateParameterType(obj, e, false, obj.IsList, obj.HasPersistentOrder); }
protected virtual void ApplyCompoundObjectListTemplate(CompoundObjectProperty prop) { this.WriteLine(" // CompoundObject list property"); ApplyListProperty(prop, this.MembersToSerialize); }
public bool IsRenameCompoundObjectPropertyListName(CompoundObjectProperty prop) { var saved = savedSchema.FindPersistenceObject<CompoundObjectProperty>(prop.ExportGuid); if (saved == null) return false; return saved.Name != prop.Name; }