private static IList GetLinkedEntities(IUnitOfWork uow, ClearDependenceInfo depend, IDomainObject masterEntity) { var list = uow.Session.CreateCriteria(depend.ObjectClass) .Add(Restrictions.Eq(depend.PropertyName + ".Id", masterEntity.Id)).List(); return(list); }
IList <EntityDTO> IDeleteInfo.GetDependEntities(IDeleteCore core, ClearDependenceInfo depend, EntityDTO masterEntity) { var list = core.UoW.Session.CreateCriteria(ObjectClass) .Add(Restrictions.Eq(depend.PropertyName + ".Id", (int)masterEntity.Id)).List(); return(MakeResultList(list)); }
public Operation CreateClearOperation(EntityDTO masterEntity, ClearDependenceInfo depend, IList <EntityDTO> dependEntities) { return(new HibernateCleanOperation { ItemId = masterEntity.Id, ClearingItems = dependEntities, EntityType = depend.ObjectClass, PropertyName = depend.PropertyName }); }
public Operation CreateClearOperation(EntityDTO masterEntity, ClearDependenceInfo depend, IList <EntityDTO> dependEntities) { return(new SQLCleanOperation() { ItemId = masterEntity.Id, TableName = TableName, CleanField = depend.ClearField, WhereStatment = depend.WhereStatment }); }
public static void AddClearDependence <ToClass> (ClearDependenceInfo clearDependence) { var info = ClassInfos.Find(i => i.ObjectClass == typeof(ToClass)); if (info == null) { throw new InvalidOperationException(String.Format("Описание удаления для класса {0} не найдено.", typeof(ToClass))); } info.ClearItems.Add(clearDependence); }
public static void AddClearDependence <ToClass> (ClearDependenceInfo clearDependence) { Main.AddClearDependence <ToClass>(clearDependence); }
public DeleteInfoHibernate <TEntity> AddClearDependence <TDependOn>(Expression <Func <TDependOn, object> > propertyRefExpr) { ClearItems.Add(ClearDependenceInfo.Create <TDependOn> (propertyRefExpr)); return(this); }
IList <EntityDTO> IDeleteInfo.GetDependEntities(IDeleteCore core, ClearDependenceInfo depend, EntityDTO masterEntity) { return(GetEntitiesList(depend.WhereStatment, masterEntity.Id)); }