public int AddEntityLeftJoinCustomKey(IAbstractDal pObj, string pEntityFrom, string pKey, VO.CustomKeyHand pHand, bool pReadOnly) { string lLeftKey = pObj.EntityKey; string lRightKey = pObj.EntityKey; switch (pHand) { case VO.CustomKeyHand.Left: lLeftKey = pKey; break; case VO.CustomKeyHand.Right: lRightKey = pKey; break; case VO.CustomKeyHand.Both: lLeftKey = lRightKey = pKey; break; } if (string.IsNullOrEmpty(pObj.Database)) { pObj.Database = DatabaseDefault; } if (string.IsNullOrEmpty(pObj.Schema)) { pObj.Schema = SchemaDefault; } pObj.EntityLeft = true; pObj.EntityAlias = (++EntityCount).ToString(); var lEntity = string.Concat("[", pObj.Database, "].[", pObj.Schema, "].[", pObj.Entity, "]", " as [", pObj.EntityAlias, "]"); Entities.Append(string.Concat(" left join ", lEntity, " on [", pEntityFrom, "].[", lLeftKey, "] = [", pObj.EntityAlias, "].[", lRightKey, "] ")).AppendLine(); if (pEntityFrom == "1" && (!pReadOnly && Persistence)) { SaveAtributes.Add(pKey, string.Concat("@", pKey)); } pObj.Query = this; return(EntityCount); }
public int AddEntityLeftJoinCustomKey(IAbstractDal pObj, string pEntityFrom, string pKey, VO.CustomKeyHand pHand = VO.CustomKeyHand.Left) { return(AddEntityLeftJoinCustomKey(pObj, pEntityFrom, pKey, pHand, false)); }