Exemplo n.º 1
0
        public void HandleSubclass(PersistentClass model, XmlNode subnode)
        {
            Subclass subclass = new SingleTableSubclass(model);

            BindClass(subnode, subclass);

            if (subclass.EntityPersisterClass == null)
                subclass.RootClazz.EntityPersisterClass = typeof(SingleTableEntityPersister);

            log.InfoFormat("Mapping subclass: {0} -> {1}", subclass.EntityName, subclass.Table.Name);

            // properties
            PropertiesFromXML(subnode, subclass);

            model.AddSubclass(subclass);
            mappings.AddClass(subclass);
        }
		public void HandleSubclass(PersistentClass model, XmlNode subnode, IDictionary<string, MetaAttribute> inheritedMetas)
		{
			Subclass subclass = new SingleTableSubclass(model);

			BindClass(subnode, null, subclass, inheritedMetas);

			inheritedMetas = GetMetas(subnode.SelectNodes(HbmConstants.nsMeta, namespaceManager), inheritedMetas, true); // get meta's from <subclass>

			if (subclass.EntityPersisterClass == null)
				subclass.RootClazz.EntityPersisterClass = typeof(SingleTableEntityPersister);

			log.InfoFormat("Mapping subclass: {0} -> {1}", subclass.EntityName, subclass.Table.Name);

			// properties
			PropertiesFromXML(subnode, subclass, inheritedMetas);

			model.AddSubclass(subclass);
			mappings.AddClass(subclass);
		}
Exemplo n.º 3
0
		public void HandleSubclass(PersistentClass model, HbmSubclass subClassMapping, IDictionary<string, MetaAttribute> inheritedMetas)
		{
			Subclass subclass = new SingleTableSubclass(model);

			BindClass(subClassMapping, subclass, inheritedMetas);
			inheritedMetas = GetMetas(subClassMapping, inheritedMetas, true); // get meta's from <subclass>

			if (subclass.EntityPersisterClass == null)
				subclass.RootClazz.EntityPersisterClass = typeof(SingleTableEntityPersister);

			log.InfoFormat("Mapping subclass: {0} -> {1}", subclass.EntityName, subclass.Table.Name);

			// properties
			new PropertiesBinder(mappings, subclass, dialect).Bind(subClassMapping.Properties, inheritedMetas);
			BindJoins(subClassMapping.Joins, subclass, inheritedMetas);
			BindSubclasses(subClassMapping.Subclasses, subclass, inheritedMetas);

			model.AddSubclass(subclass);
			mappings.AddClass(subclass);
		}