private void BindPocoRepresentation(IEntityMapping classMapping, PersistentClass entity) { string className = classMapping.Name == null ? null : ClassForNameChecked(classMapping.Name, mappings, "persistent class {0} not found"). AssemblyQualifiedName; entity.ClassName = className; if (!string.IsNullOrEmpty(classMapping.Proxy)) { entity.ProxyInterfaceName = ClassForNameChecked(classMapping.Proxy, mappings, "proxy class not found: {0}").AssemblyQualifiedName; entity.IsLazy = true; } else if (entity.IsLazy) entity.ProxyInterfaceName = className; HbmTuplizer tuplizer = classMapping.Tuplizers.FirstOrDefault(tp=> tp.entitymode == HbmTuplizerEntitymode.Poco); if (tuplizer != null) { string tupClassName = FullQualifiedClassName(tuplizer.@class, mappings); entity.AddTuplizer(EntityMode.Poco, tupClassName); } }
private void BindXmlRepresentation(IEntityMapping classMapping, PersistentClass entity) { entity.NodeName = string.IsNullOrEmpty(classMapping.Node) ? StringHelper.Unqualify(entity.EntityName): classMapping.Node; HbmTuplizer tuplizer = classMapping.Tuplizers.FirstOrDefault(tp => tp.entitymode == HbmTuplizerEntitymode.Xml); if (tuplizer != null) { string tupClassName = FullQualifiedClassName(tuplizer.@class, mappings); entity.AddTuplizer(EntityMode.Xml, tupClassName); } }
private void BindMapRepresentation(IEntityMapping classMapping, PersistentClass entity) { HbmTuplizer tuplizer = classMapping.Tuplizers.FirstOrDefault(tp => tp.entitymode == HbmTuplizerEntitymode.DynamicMap); if (tuplizer != null) { string tupClassName = FullQualifiedClassName(tuplizer.@class, mappings); entity.AddTuplizer(EntityMode.Map, tupClassName); } }
private void BindPocoRepresentation(XmlNode node, PersistentClass entity) { string className = node.Attributes["name"] == null ? null : ClassForNameChecked(node.Attributes["name"].Value, mappings, "persistent class {0} not found"). AssemblyQualifiedName; entity.ClassName = className; XmlAttribute proxyNode = node.Attributes["proxy"]; if (proxyNode != null) { entity.ProxyInterfaceName = ClassForNameChecked(proxyNode.Value, mappings, "proxy class not found: {0}").AssemblyQualifiedName; entity.IsLazy = true; } else if (entity.IsLazy) entity.ProxyInterfaceName = className; XmlNode tuplizer = LocateTuplizerDefinition(node, EntityMode.Poco); if (tuplizer != null) { string tupClassName = FullQualifiedClassName(tuplizer.Attributes["class"].Value, mappings); entity.AddTuplizer(EntityMode.Poco, tupClassName); } }
private void BindXmlRepresentation(XmlNode node, PersistentClass entity) { string nodeName = null; XmlAttribute nodeAtt = node.Attributes["node"]; if(nodeAtt != null) nodeName = nodeAtt.Value; if (nodeName == null) nodeName = StringHelper.Unqualify(entity.EntityName); entity.NodeName = nodeName; XmlNode tuplizer = LocateTuplizerDefinition(node, EntityMode.Xml); if (tuplizer != null) { string tupClassName = FullQualifiedClassName(tuplizer.Attributes["class"].Value, mappings); entity.AddTuplizer(EntityMode.Xml, tupClassName); } }
private void BindMapRepresentation(XmlNode node, PersistentClass entity) { XmlNode tuplizer = LocateTuplizerDefinition(node, EntityMode.Map); if (tuplizer != null) { string tupClassName = FullQualifiedClassName(tuplizer.Attributes["class"].Value, mappings); entity.AddTuplizer(EntityMode.Map, tupClassName); } }