Пример #1
0
        protected XmlDocument WriteComponent(string element, IComponentMapping mapping)
        {
            var doc = new XmlDocument();
            var componentElement = doc.AddElement(element);

            if (mapping.IsSpecified("Name"))
            {
                componentElement.WithAtt("name", mapping.Name);
            }

            if (mapping.IsSpecified("Insert"))
            {
                componentElement.WithAtt("insert", mapping.Insert);
            }

            if (mapping.IsSpecified("Update"))
            {
                componentElement.WithAtt("update", mapping.Update);
            }

            if (mapping.IsSpecified("Access"))
            {
                componentElement.WithAtt("access", mapping.Access);
            }

            if (mapping.IsSpecified("OptimisticLock"))
            {
                componentElement.WithAtt("optimistic-lock", mapping.OptimisticLock);
            }

            return(doc);
        }
Пример #2
0
        protected XmlDocument WriteComponent(string element, ComponentMappingBase mapping)
        {
            var doc = new XmlDocument();
            var componentElement = doc.AddElement(element);

            if (mapping.HasValue(x => x.Name))
            {
                componentElement.WithAtt("name", mapping.Name);
            }

            if (mapping.HasValue(x => x.Insert))
            {
                componentElement.WithAtt("insert", mapping.Insert);
            }

            if (mapping.HasValue(x => x.Update))
            {
                componentElement.WithAtt("update", mapping.Update);
            }

            if (mapping.HasValue(x => x.Access))
            {
                componentElement.WithAtt("access", mapping.Access);
            }

            if (mapping.HasValue(x => x.OptimisticLock))
            {
                componentElement.WithAtt("optimistic-lock", mapping.OptimisticLock);
            }

            return(doc);
        }
Пример #3
0
        public override void ProcessVersion(VersionMapping mapping)
        {
            document = new XmlDocument();

            var element = document.AddElement("version");

            if (mapping.HasValue("Access"))
            {
                element.WithAtt("access", mapping.Access);
            }

            if (mapping.HasValue("Generated"))
            {
                element.WithAtt("generated", mapping.Generated);
            }

            if (mapping.HasValue("Name"))
            {
                element.WithAtt("name", mapping.Name);
            }

            if (mapping.HasValue("Type"))
            {
                element.WithAtt("type", mapping.Type);
            }

            if (mapping.HasValue("UnsavedValue"))
            {
                element.WithAtt("unsaved-value", mapping.UnsavedValue);
            }
        }
        public override void ProcessKeyProperty(KeyPropertyMapping mapping)
        {
            document = new XmlDocument();

            var element = document.AddElement("key-property");

            if (mapping.HasValue(x => x.Name))
            {
                element.WithAtt("name", mapping.Name);
            }

            if (mapping.HasValue(x => x.Access))
            {
                element.WithAtt("access", mapping.Access);
            }

            if (mapping.HasValue(x => x.Type))
            {
                element.WithAtt("type", mapping.Type);
            }

            if (mapping.HasValue(x => x.Length))
            {
                element.WithAtt("length", mapping.Length);
            }
        }
Пример #5
0
        public override void ProcessId(IdMapping mapping)
        {
            document = new XmlDocument();

            var element = document.AddElement("id");

            if (mapping.HasValue("Access"))
            {
                element.WithAtt("access", mapping.Access);
            }

            if (mapping.HasValue("Name"))
            {
                element.WithAtt("name", mapping.Name);
            }

            if (mapping.HasValue("Type"))
            {
                element.WithAtt("type", mapping.Type);
            }

            if (mapping.HasValue("UnsavedValue"))
            {
                element.WithAtt("unsaved-value", mapping.UnsavedValue);
            }
        }
Пример #6
0
        public override void ProcessArray(ArrayMapping mapping)
        {
            document = new XmlDocument();

            var element = document.AddElement("array");

            WriteBaseCollectionAttributes(element, mapping);
        }
Пример #7
0
        private static XmlElement CreateTemplateXmlElement(XmlDocument xmlDoc, IContentClassFolder folder)
        {
            XmlElement template = xmlDoc.AddElement("TEMPLATE");

            template.AddAttribute("action", "addnew");
            template.AddAttribute("folderguid", folder.Guid.ToRQLString());
            return(template);
        }
Пример #8
0
        public override void ProcessCollection(CollectionMapping mapping)
        {
            document = new XmlDocument();

            var element = document.AddElement("list");

            WriteBaseCollectionAttributes(element, mapping);
        }
        public override void ProcessStoredProcedure(StoredProcedureMapping mapping)
        {
            document = new XmlDocument();

            var element = document.AddElement(mapping.SPType);

            element.WithAtt("check", mapping.Check);
            element.InnerXml = mapping.Query;
        }
Пример #10
0
        public override void ProcessSubclass(SubclassMapping mapping)
        {
            document = new XmlDocument();

            var element = document.AddElement("subclass");

            if (mapping.HasValue(x => x.Name))
            {
                element.WithAtt("name", mapping.Name);
            }

            if (mapping.HasValue(x => x.DiscriminatorValue))
            {
                element.WithAtt("discriminator-value", mapping.DiscriminatorValue.ToString());
            }

            if (mapping.HasValue(x => x.Extends))
            {
                element.WithAtt("extends", mapping.Extends);
            }

            if (mapping.HasValue(x => x.Proxy))
            {
                element.WithAtt("proxy", mapping.Proxy);
            }

            if (mapping.HasValue(x => x.Lazy))
            {
                element.WithAtt("lazy", mapping.Lazy);
            }

            if (mapping.HasValue(x => x.DynamicUpdate))
            {
                element.WithAtt("dynamic-update", mapping.DynamicUpdate);
            }

            if (mapping.HasValue(x => x.DynamicInsert))
            {
                element.WithAtt("dynamic-insert", mapping.DynamicInsert);
            }

            if (mapping.HasValue(x => x.SelectBeforeUpdate))
            {
                element.WithAtt("select-before-update", mapping.SelectBeforeUpdate);
            }

            if (mapping.HasValue(x => x.Abstract))
            {
                element.WithAtt("abstract", mapping.Abstract);
            }

            if (mapping.HasValue(x => x.EntityName))
            {
                element.WithAtt("entity-name", mapping.EntityName);
            }
        }
Пример #11
0
        public override void ProcessManyToMany(ManyToManyMapping mapping)
        {
            document = new XmlDocument();

            var element = document.AddElement("many-to-many");

            if (mapping.HasValue(x => x.Class))
            {
                element.WithAtt("class", mapping.Class);
            }

            if (mapping.HasValue(x => x.Fetch))
            {
                element.WithAtt("fetch", mapping.Fetch);
            }

            if (mapping.HasValue(x => x.ForeignKey))
            {
                element.WithAtt("foreign-key", mapping.ForeignKey);
            }

            if (mapping.HasValue(x => x.ChildPropertyRef))
            {
                element.WithAtt("property-ref", mapping.ChildPropertyRef);
            }

            if (mapping.HasValue(x => x.Lazy))
            {
                element.WithAtt("lazy", mapping.Lazy);
            }

            if (mapping.HasValue(x => x.NotFound))
            {
                element.WithAtt("not-found", mapping.NotFound);
            }

            if (mapping.HasValue(x => x.Where))
            {
                element.WithAtt("where", mapping.Where);
            }

            if (mapping.HasValue(x => x.EntityName))
            {
                element.WithAtt("entity-name", mapping.EntityName);
            }

            if (mapping.HasValue(x => x.OrderBy))
            {
                element.WithAtt("order-by", mapping.OrderBy);
            }

            if (mapping.HasValue(x => x.Formula))
            {
                element.WithAtt("formula", mapping.Formula);
            }
        }
        public override void ProcessOneToOne(OneToOneMapping mapping)
        {
            document = new XmlDocument();

            var element = document.AddElement("one-to-one");

            if (mapping.HasValue(x => x.Access))
            {
                element.WithAtt("access", mapping.Access);
            }

            if (mapping.HasValue(x => x.Cascade))
            {
                element.WithAtt("cascade", mapping.Cascade);
            }

            if (mapping.HasValue(x => x.Class))
            {
                element.WithAtt("class", mapping.Class);
            }

            if (mapping.HasValue(x => x.Constrained))
            {
                element.WithAtt("constrained", mapping.Constrained);
            }

            if (mapping.HasValue(x => x.Fetch))
            {
                element.WithAtt("fetch", mapping.Fetch);
            }

            if (mapping.HasValue(x => x.ForeignKey))
            {
                element.WithAtt("foreign-key", mapping.ForeignKey);
            }

            if (mapping.HasValue(x => x.Lazy))
            {
                element.WithAtt("lazy", mapping.Lazy);
            }

            if (mapping.HasValue(x => x.Name))
            {
                element.WithAtt("name", mapping.Name);
            }

            if (mapping.HasValue(x => x.PropertyRef))
            {
                element.WithAtt("property-ref", mapping.PropertyRef);
            }

            if (mapping.HasValue(x => x.EntityName))
            {
                element.WithAtt("entity-name", mapping.EntityName);
            }
        }
Пример #13
0
        public override void ProcessOneToOne(OneToOneMapping mapping)
        {
            document = new XmlDocument();

            var element = document.AddElement("one-to-one");

            if (mapping.IsSpecified("Access"))
            {
                element.WithAtt("access", mapping.Access);
            }

            if (mapping.IsSpecified("Cascade"))
            {
                element.WithAtt("cascade", mapping.Cascade);
            }

            if (mapping.IsSpecified("Class"))
            {
                element.WithAtt("class", mapping.Class);
            }

            if (mapping.IsSpecified("Constrained"))
            {
                element.WithAtt("constrained", mapping.Constrained);
            }

            if (mapping.IsSpecified("Fetch"))
            {
                element.WithAtt("fetch", mapping.Fetch);
            }

            if (mapping.IsSpecified("ForeignKey"))
            {
                element.WithAtt("foreign-key", mapping.ForeignKey);
            }

            if (mapping.IsSpecified("Lazy"))
            {
                element.WithAtt("lazy", mapping.Lazy);
            }

            if (mapping.IsSpecified("Name"))
            {
                element.WithAtt("name", mapping.Name);
            }

            if (mapping.IsSpecified("PropertyRef"))
            {
                element.WithAtt("property-ref", mapping.PropertyRef);
            }

            if (mapping.IsSpecified("EntityName"))
            {
                element.WithAtt("entity-name", mapping.EntityName);
            }
        }
        public override void ProcessNaturalId(NaturalIdMapping mapping)
        {
            document = new XmlDocument();

            var element = document.AddElement("natural-id");

            if (mapping.HasValue(x => x.Mutable))
            {
                element.WithAtt("mutable", mapping.Mutable);
            }
        }
Пример #15
0
        public override void ProcessParent(ParentMapping parentMapping)
        {
            document = new XmlDocument();

            var parentElement = document.AddElement("parent");

            if (parentMapping.IsSpecified("Name"))
            {
                parentElement.WithAtt("name", parentMapping.Name);
            }
        }
Пример #16
0
        public override void ProcessParent(ParentMapping parentMapping)
        {
            document = new XmlDocument();

            var parentElement = document.AddElement("parent");

            if (parentMapping.HasValue(x => x.Name))
            {
                parentElement.WithAtt("name", parentMapping.Name);
            }
        }
        public override void ProcessCompositeIndex(CompositeIndexMapping mapping)
        {
            document = new XmlDocument();

            var element = document.AddElement("composite-index");

            if (mapping.HasValue(x => x.Type))
            {
                element.WithAtt("class", mapping.Type);
            }
        }
Пример #18
0
        public override void ProcessNaturalId(NaturalIdMapping mapping)
        {
            document = new XmlDocument();

            var element = document.AddElement("natural-id");

            if (mapping.IsSpecified("Mutable"))
            {
                element.WithAtt("mutable", mapping.Mutable);
            }
        }
Пример #19
0
        public override void ProcessIndex(IndexMapping mapping)
        {
            document = new XmlDocument();

            var element = document.AddElement("index");

            if (mapping.HasValue(x => x.Type))
            {
                element.WithAtt("type", mapping.Type);
            }
        }
Пример #20
0
        public override void ProcessCompositeElement(CompositeElementMapping mapping)
        {
            document = new XmlDocument();

            var element = document.AddElement("composite-element");

            if (mapping.HasValue(x => x.Class))
            {
                element.WithAtt("class", mapping.Class);
            }
        }
        public override void ProcessCompositeElement(CompositeElementMapping mapping)
        {
            document = new XmlDocument();

            var name    = mapping is NestedCompositeElementMapping ? "nested-composite-element" : "composite-element";
            var element = document.AddElement(name);

            if (mapping.HasValue(x => x.Class))
            {
                element.WithAtt("class", mapping.Class);
            }
        }
Пример #22
0
        public override void ProcessCollection(CollectionMapping mapping)
        {
            document = new XmlDocument();

            var element = document.AddElement("bag");

            WriteBaseCollectionAttributes(element, mapping);

            if (mapping.IsSpecified("OrderBy"))
            {
                element.WithAtt("order-by", mapping.OrderBy);
            }
        }
Пример #23
0
        public override void ProcessBag(BagMapping mapping)
        {
            document = new XmlDocument();

            var element = document.AddElement("bag");

            WriteBaseCollectionAttributes(element, mapping);

            if (mapping.HasValue(x => x.OrderBy))
            {
                element.WithAtt("order-by", mapping.OrderBy);
            }
        }
Пример #24
0
        public override void ProcessManyToMany(ManyToManyMapping mapping)
        {
            document = new XmlDocument();

            var element = document.AddElement("many-to-many");

            if (mapping.IsSpecified("Class"))
            {
                element.WithAtt("class", mapping.Class);
            }

            if (mapping.IsSpecified("Fetch"))
            {
                element.WithAtt("fetch", mapping.Fetch);
            }

            if (mapping.IsSpecified("ForeignKey"))
            {
                element.WithAtt("foreign-key", mapping.ForeignKey);
            }

            if (mapping.IsSpecified("ChildPropertyRef"))
            {
                element.WithAtt("property-ref", mapping.ChildPropertyRef);
            }

            if (mapping.IsSpecified("Lazy"))
            {
                element.WithAtt("lazy", mapping.Lazy);
            }

            if (mapping.IsSpecified("NotFound"))
            {
                element.WithAtt("not-found", mapping.NotFound);
            }

            if (mapping.IsSpecified("Where"))
            {
                element.WithAtt("where", mapping.Where);
            }

            if (mapping.IsSpecified("EntityName"))
            {
                element.WithAtt("entity-name", mapping.EntityName);
            }

            if (mapping.IsSpecified("OrderBy"))
            {
                element.WithAtt("order-by", mapping.OrderBy);
            }
        }
Пример #25
0
        public override void ProcessAny(AnyMapping mapping)
        {
            document = new XmlDocument();

            var element = document.AddElement("any");

            if (mapping.HasValue(x => x.Access))
            {
                element.WithAtt("access", mapping.Access);
            }

            if (mapping.HasValue(x => x.Cascade))
            {
                element.WithAtt("cascade", mapping.Cascade);
            }

            if (mapping.HasValue(x => x.IdType))
            {
                element.WithAtt("id-type", mapping.IdType);
            }

            if (mapping.HasValue(x => x.Insert))
            {
                element.WithAtt("insert", mapping.Insert);
            }

            if (mapping.HasValue(x => x.MetaType))
            {
                element.WithAtt("meta-type", mapping.MetaType);
            }

            if (mapping.HasValue(x => x.Name))
            {
                element.WithAtt("name", mapping.Name);
            }

            if (mapping.HasValue(x => x.Update))
            {
                element.WithAtt("update", mapping.Update);
            }

            if (mapping.HasValue(x => x.Lazy))
            {
                element.WithAtt("lazy", mapping.Lazy);
            }

            if (mapping.HasValue(x => x.OptimisticLock))
            {
                element.WithAtt("optimistic-lock", mapping.OptimisticLock);
            }
        }
Пример #26
0
        public override void ProcessAny(AnyMapping mapping)
        {
            document = new XmlDocument();

            var element = document.AddElement("any");

            if (mapping.IsSpecified("Access"))
            {
                element.WithAtt("access", mapping.Access);
            }

            if (mapping.IsSpecified("Cascade"))
            {
                element.WithAtt("cascade", mapping.Cascade);
            }

            if (mapping.IsSpecified("IdType"))
            {
                element.WithAtt("id-type", mapping.IdType);
            }

            if (mapping.IsSpecified("Insert"))
            {
                element.WithAtt("insert", mapping.Insert);
            }

            if (mapping.IsSpecified("MetaType"))
            {
                element.WithAtt("meta-type", mapping.MetaType);
            }

            if (mapping.IsSpecified("Name"))
            {
                element.WithAtt("name", mapping.Name);
            }

            if (mapping.IsSpecified("Update"))
            {
                element.WithAtt("update", mapping.Update);
            }

            if (mapping.IsSpecified("Lazy"))
            {
                element.WithAtt("lazy", mapping.Lazy);
            }

            if (mapping.IsSpecified("OptimisticLock"))
            {
                element.WithAtt("optimistic-lock", mapping.OptimisticLock);
            }
        }
Пример #27
0
        public override void ProcessHibernateMapping(HibernateMapping mapping)
        {
            document = new XmlDocument();

            var element = document.AddElement("hibernate-mapping");

            element.WithAtt("xmlns", "urn:nhibernate-mapping-2.2");

            if (mapping.IsSpecified("DefaultAccess"))
            {
                element.WithAtt("default-access", mapping.DefaultAccess);
            }

            if (mapping.IsSpecified("AutoImport"))
            {
                element.WithAtt("auto-import", mapping.AutoImport);
            }

            if (mapping.IsSpecified("Schema"))
            {
                element.WithAtt("schema", mapping.Schema);
            }

            if (mapping.IsSpecified("DefaultCascade"))
            {
                element.WithAtt("default-cascade", mapping.DefaultCascade);
            }

            if (mapping.IsSpecified("DefaultLazy"))
            {
                element.WithAtt("default-lazy", mapping.DefaultLazy);
            }

            if (mapping.IsSpecified("Catalog"))
            {
                element.WithAtt("catalog", mapping.Catalog);
            }

            if (mapping.IsSpecified("Namespace"))
            {
                element.WithAtt("namespace", mapping.Namespace);
            }

            if (mapping.IsSpecified("Assembly"))
            {
                element.WithAtt("assembly", mapping.Assembly);
            }
        }
Пример #28
0
        public override void ProcessIndex(IndexManyToManyMapping mapping)
        {
            document = new XmlDocument();

            var element = document.AddElement("index-many-to-many");

            if (mapping.HasValue(x => x.Class))
            {
                element.WithAtt("class", mapping.Class);
            }

            if (mapping.HasValue(x => x.ForeignKey))
            {
                element.WithAtt("foreign-key", mapping.ForeignKey);
            }
        }
Пример #29
0
        public override void ProcessElement(ElementMapping mapping)
        {
            document = new XmlDocument();

            var element = document.AddElement("element");

            if (mapping.IsSpecified("Type"))
            {
                element.WithAtt("type", mapping.Type);
            }

            if (mapping.IsSpecified("Formula"))
            {
                element.WithAtt("formula", mapping.Formula);
            }
        }
        public override void ProcessMetaValue(MetaValueMapping mapping)
        {
            document = new XmlDocument();

            var element = document.AddElement("meta-value");

            if (mapping.HasValue(x => x.Value))
            {
                element.WithAtt("value", mapping.Value);
            }

            if (mapping.HasValue(x => x.Class))
            {
                element.WithAtt("class", mapping.Class);
            }
        }