/// <summary> /// 数据访问实现:删除用户 /// </summary> /// <param name="entity">参数:实体对象(Consumer:用户)</param> /// <returns></returns> public bool DeleteConsumer(Consumer entity) { HibernateTemplate.Delete(entity); return(true); throw new NotImplementedException(); }
/// <summary> /// 删除 /// </summary> /// <param name="entity"></param> /// <returns></returns> public bool Delete(FavoriteItem entity) { HibernateTemplate.Delete(entity); return(true); throw new NotImplementedException(); }
/// <summary> /// 数据访问实现:删除单个实体对象信息 /// </summary> /// <param name="entity">参数:Product 实体对象</param> /// <returns>返回:bool</returns> public bool DeleteProducts(DemoProduct entity) { HibernateTemplate.Delete(entity); return(true); throw new NotImplementedException(); }
/// <summary> /// 删除 /// </summary> /// <param name="entity"></param> /// <returns></returns> public bool Delete(WeixinBaseConfigure entity) { HibernateTemplate.Delete(entity); return(true); throw new NotImplementedException(); }
public void Delete(TObj obj) { if (obj is null) { throw new ArgumentNullException(nameof(obj)); } HibernateTemplate.Delete(obj); }
public void DeleteContainer(string containerName) { IList <Container> result = FindContainer(containerName); foreach (Container container in result) { HibernateTemplate.Delete(container); } }
public void TearDown() { Ca.Infoway.Messagebuilder.CollUtils.Reverse(this.createdObjects); for (IIterator <Object> iterator = new ILOG.J2CsMapping.Collections.Generics.IteratorAdapter <System.Object>(this.createdObjects.GetEnumerator()); iterator .HasNext();) { Object createdObj = iterator.Next(); HibernateTemplate.Delete(createdObj); } ILOG.J2CsMapping.Collections.Generics.Collections.Clear(this.createdObjects); }
public void DeleteBlob(string containerName, string blobName) { IList <Blob> result = FindContainerBlob(containerName, blobName); if (result != null) { foreach (Blob blob in result) { HibernateTemplate.Delete(blob); } } }
public void DeleteByViewId(int viewId) { string[] paramNames = { "viewId" }; object[] paramValues = { viewId }; IList <ViewComponentPropertyReference> l = HibernateTemplate.FindByNamedQueryAndNamedParam <ViewComponentPropertyReference>("ViewComponentPropertyReference.FindByViewId", paramNames, paramValues); foreach (ViewComponentPropertyReference vpr in l) { HibernateTemplate.Delete(vpr); } }
public virtual void Delete(T daoObj) { if (daoObj is BaseEntity) { long id = (daoObj as BaseEntity).ID; DoDeleteEntities(new long[] { id }); OnDaoEntitiesChanged(id); } else { HibernateTemplate.Delete(daoObj); } }
public void DeleteAllForQuery(Guid queryId) { string[] paramNames = { "queryId" }; object[] paramValues = { queryId }; IList <QueryProperty> result = HibernateTemplate.FindByNamedQueryAndNamedParam <QueryProperty>( "QueryProperty.FindAllByQueryId", paramNames, paramValues); foreach (QueryProperty qp in result) { HibernateTemplate.Delete(qp); } }
public void Delete(ReuseTech obj, UserProfiles up, IList matchList) { HibernateTemplate.Delete(obj); if (up != null) { HibernateTemplate.Delete(up); } if (matchList != null) { foreach (Match item in matchList) { HibernateTemplate.Update(item); } } }
public void DeleteAll(IList obj, UserProfiles up) { if (obj != null) { foreach (ReuseTech item in obj) { HibernateTemplate.Delete(item); } } if (up != null) { HibernateTemplate.Delete(up); } }
public bool RemoveAuthorityList(List <int> idList, int uid, int gid) { var authorityList = HibernateTemplate.ExecuteFind <AuthorityInfo>(x => { var c = x.CreateCriteria <AuthorityInfo>() .Add(Restrictions.And(Restrictions.In("ActionId", idList), Restrictions.Or(Expression.Eq("UserId", uid), Expression.Eq("GroupId", gid)))); return(c.List <AuthorityInfo>()); }); foreach (var a in authorityList) { HibernateTemplate.Delete(a); } return(true); }
public void Delete(string id) { var entity = Get(id); if (entity == null) { return; } try { HibernateTemplate.Delete(entity); } catch (Exception e) { Log.Error( $"Exception occured when application tried to delete the object with id = {id}", e); throw; } }
public virtual void DeleteList(IList list) { if ((list != null) && (list.Count > 0)) { List <long> ids = new List <long>(); foreach (T obj in list) { if (obj is BaseEntity) { ids.Add((obj as BaseEntity).ID); } else { HibernateTemplate.Delete(obj); } } if (ids.Count > 0) { DoDeleteEntities(ids); OnDaoEntitiesChanged(ids); } } }
public void Delete(Dialog dialog) { HibernateTemplate.Delete(dialog); }
public void Delete(Issue issue) { HibernateTemplate.Delete(issue); }
public void Delete(TechInfo obj) { HibernateTemplate.Delete(obj);; }
public void Remove(T entity) { HibernateTemplate.Delete(entity); }
public void Delete(UXApplication uxApplication) { HibernateTemplate.Delete(uxApplication); }
public void Delete(ReportQuery reportQuery) { HibernateTemplate.Delete(reportQuery); }
public void Delete(Service service) { HibernateTemplate.Delete(service); }
public void Delete(int id) { HibernateTemplate.Delete(new User { Id = id }); }
public void Delete(UXAction action) { HibernateTemplate.Delete(action); }
//private HibernateTemplate ht; //public ISessionFactory sf { set; get; } //private void setHibernateTemplate() //{ // if (null == ht) // { // ht = new HibernateTemplate(this.sf); // ht.TemplateFlushMode = TemplateFlushMode.Auto; // ht.CacheQueries = true; // } //} public void delete(User user) { //sf.GetCurrentSession().Delete(tb_user); HibernateTemplate.Delete(user); }
public void DeleteEntity(object entity) { HibernateTemplate.Delete(entity); }
public void Delete(ViewComponentPropertyReference viewComponentPropertyReference) { HibernateTemplate.Delete(viewComponentPropertyReference); }
public void Delete(Property property) { HibernateTemplate.Delete(property); }
protected virtual void DoDeleteEntities(IEnumerable <long> idlist) { if (idlist != null) { User u = AuthorizationService.GetCurrentUser(); if (!u.UserRoleID.HasValue) { throw new AccessDeniedException("User have no rights to delete entity"); } UserRoleId role = (UserRoleId)(u.UserRoleID.Value); if (role == UserRoleId.Controlling) { throw new AccessDeniedException("User have no rights to delete entity"); } /* * if (role != UserRoleId.GlobalAdmin) * { * List<string> pNames = new List<string>(); * List<object> pValues = new List<object>(); * string idListStr = QueryUtils.GenIDList(idlist, pNames, pValues); * // nothing to delete? * if ((idListStr == null) || (idListStr.Length == 0)) * { * return; * } * IList list = * FindByNamedParam(new string[] {"entity.ID"}, null, * string.Format("entity.ID IN ({0})", idListStr), null, * pNames.ToArray(), pValues.ToArray(), false); * if ((list == null) || (list.Count != pNames.Count)) * { * throw new AccessDeniedException("User have no rights to delete entity"); * } * } * */ StringBuilder sb = new StringBuilder(); sb.AppendFormat("FROM {0} entity WHERE entity.ID IN (", typeof(T).Name); List <object> values = new List <object>(); List <IType> types = new List <IType>(); IEnumerator <long> ie = idlist.GetEnumerator(); ie.Reset(); if (ie.MoveNext()) { long current = (ie.Current); sb.Append("?"); values.Add(current); types.Add(NHibernateUtil.Int64); while (ie.MoveNext()) { current = (ie.Current); sb.Append(",?"); values.Add(current); types.Add(NHibernateUtil.Int64); } } if (values.Count > 0) { sb.Append(")"); HibernateTemplate.Delete(sb.ToString(), values.ToArray(), types.ToArray()); } } }