Ejemplo n.º 1
0
        IList <EntityDTO> IDeleteInfo.GetDependEntities(IDeleteCore core, RemoveFromDependenceInfo depend, EntityDTO masterEntity)
        {
            var list = core.UoW.Session.CreateCriteria(ObjectClass)
                       .CreateAlias(depend.CollectionName, "childs")
                       .Add(Restrictions.Eq(String.Format("childs.Id", depend.CollectionName), (int)masterEntity.Id)).List();

            return(MakeResultList(list));
        }
Ejemplo n.º 2
0
 public Operation CreateRemoveFromOperation(EntityDTO masterEntity, RemoveFromDependenceInfo depend, IList <EntityDTO> dependEntities)
 {
     return(new HibernateRemoveFromCollectionOperation {
         RemoveInClassType = depend.ObjectClass,
         RemoveInItems = dependEntities,
         CollectionName = depend.CollectionName,
         RemoveMethodName = depend.RemoveMethodName,
         RemovingEntity = masterEntity
     });
 }
Ejemplo n.º 3
0
 internal IDeleteInfo GetDeleteInfo(RemoveFromDependenceInfo removeFromDependence)
 {
     return(ClassInfos.Find(i => i.ObjectClass == removeFromDependence.ObjectClass));
 }
Ejemplo n.º 4
0
 IList <EntityDTO> IDeleteInfo.GetDependEntities(IDeleteCore core, RemoveFromDependenceInfo depend, EntityDTO masterEntity)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 5
0
 public Operation CreateRemoveFromOperation(EntityDTO masterEntity, RemoveFromDependenceInfo depend, IList <EntityDTO> dependEntities)
 {
     throw new NotSupportedException();
 }
Ejemplo n.º 6
0
 public DeleteInfoHibernate <TEntity> AddRemoveFromDependence <TFrom>(Expression <Func <TFrom, object> > collectionProperty, Expression <Func <TFrom, Action <TEntity> > > removeFunction)
 {
     RemoveFromItems.Add(RemoveFromDependenceInfo.CreateFromBag <TFrom, TEntity> (collectionProperty, removeFunction));
     return(this);
 }