示例#1
0
        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);
            }
        }
示例#2
0
        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);
            }
        }
示例#3
0
        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);
            }
        }