Пример #1
0
        protected override void ApplyClassTailTemplate()
        {
            base.ApplyClassTailTemplate();

            string interfaceName = GetCeInterface();

            List <KeyValuePair <string, string> > typeAndNameList = new List <KeyValuePair <string, string> >()
            {
                new KeyValuePair <string, string>(Mappings.ObjectClassHbm.GetProxyTypeReference(rel.A.Type, this.Settings), "A"),
                new KeyValuePair <string, string>(Mappings.ObjectClassHbm.GetProxyTypeReference(rel.B.Type, this.Settings), "B"),
            };

            if (IsOrdered())
            {
                typeAndNameList.Add(new KeyValuePair <string, string>("int?", "A" + Zetbox.API.Helper.PositionSuffix));
                typeAndNameList.Add(new KeyValuePair <string, string>("int?", "B" + Zetbox.API.Helper.PositionSuffix));
            }

            if (IsExportable())
            {
                typeAndNameList.Add(new KeyValuePair <string, string>("Guid", "ExportGuid"));
            }

            GetDeletedRelatives.Call(Host, "A", "B");

            ObjectClasses.ProxyClass.Call(Host, ctx, interfaceName, new KeyValuePair <string, string> [0], typeAndNameList);
        }
Пример #2
0
        protected override void ApplyClassTailTemplate()
        {
            base.ApplyClassTailTemplate();

            string interfaceName  = GetCeInterface();
            string referencedType = prop.GetElementTypeString();

            if (prop is CompoundObjectProperty)
            {
                referencedType += ImplementationSuffix;
            }
            List <KeyValuePair <string, string> > typeAndNameList = new List <KeyValuePair <string, string> >()
            {
                new KeyValuePair <string, string>(Mappings.ObjectClassHbm.GetProxyTypeReference(prop.ObjectClass as ObjectClass, this.Settings), "Parent"),
                new KeyValuePair <string, string>("bool", "ValueIsNull"),
                new KeyValuePair <string, string>(referencedType, "Value"),
            };

            if (IsOrdered())
            {
                typeAndNameList.Add(new KeyValuePair <string, string>("int?", "Value" + Zetbox.API.Helper.PositionSuffix));
            }

            // Even exportable value collection entries do not have an
            // export guid, since they are serialized in-place in the container
            //if (IsExportable())
            //{
            //    typeAndNameList.Add(new KeyValuePair<string, string>("Guid", "ExportGuid"));
            //}

            this.WriteLine("        public override void SaveOrUpdateTo(NHibernate.ISession session)");
            this.WriteLine("        {");
            this.WriteLine("            // ValueCollectionEntries and CompoundCollectionEntries are saved by cascade");
            this.WriteLine("            //base.SaveOrUpdateTo(session);");
            this.WriteLine("        }");
            this.WriteLine("");

            GetDeletedRelatives.Call(Host, "Parent", null);

            ObjectClasses.ProxyClass.Call(Host, ctx, interfaceName, new KeyValuePair <string, string> [0], typeAndNameList);
        }