public ToOneFkSecondPass(ToOne value, Ejb3JoinColumn[] columns, bool unique, string entityClassName, string path, ExtendedMappings mappings) : base(value, columns) { this.mappings = mappings; this.unique = unique; this.entityClassName = entityClassName; this.path = entityClassName != null ? path.Substring(entityClassName.Length + 1) : path; }
public FkSecondPass(ToOne value, Ejb3JoinColumn[] columns) { this.value = value; this.columns = columns; uniqueCounter = globalCounter.GetAndIncrement(); }
protected static void InitLaziness(HbmLaziness? laziness, ToOne fetchable, bool defaultLazy) { // Note : fetch="join" overrides default laziness bool isLazyTrue = !laziness.HasValue ? defaultLazy && fetchable.IsLazy : (laziness == HbmLaziness.Proxy || laziness == HbmLaziness.NoProxy); fetchable.IsLazy = isLazyTrue; fetchable.UnwrapProxy = laziness == HbmLaziness.NoProxy; }
protected static void InitLaziness(HbmRestrictedLaziness? restrictedLaziness, ToOne fetchable, bool defaultLazy) { // Note : fetch="join" overrides default laziness bool isLazyTrue = !restrictedLaziness.HasValue ? defaultLazy && fetchable.IsLazy : restrictedLaziness == HbmRestrictedLaziness.Proxy; fetchable.IsLazy = isLazyTrue; }
protected static void InitLaziness(XmlNode node, ToOne fetchable, bool defaultLazy) { XmlAttribute lazyNode = node.Attributes["lazy"]; if (lazyNode != null && "no-proxy".Equals(lazyNode.Value)) //fetchable.UnwrapProxy = true; fetchable.IsLazy = true; //TODO: better to degrade to lazy="false" if uninstrumented else InitLaziness(node, fetchable, "proxy", defaultLazy); }
private Property CreateProperty(ToOne value, string propertyName, System.Type parentClass, HbmKeyManyToOne keyManyToOneSchema) { if (parentClass != null && value.IsSimpleValue) value.SetTypeUsingReflection(parentClass.AssemblyQualifiedName, propertyName, keyManyToOneSchema.access ?? mappings.DefaultAccess); string propertyRef = value.ReferencedPropertyName; if (propertyRef != null) mappings.AddUniquePropertyReference(value.ReferencedEntityName, propertyRef); value.CreateForeignKey(); var prop = new Property {Value = value}; BindProperty(keyManyToOneSchema, prop); return prop; }