当前位置: 首页>>代码示例>>Java>>正文


Java Query.executeUpdate方法代码示例

本文整理汇总了Java中org.hibernate.Query.executeUpdate方法的典型用法代码示例。如果您正苦于以下问题:Java Query.executeUpdate方法的具体用法?Java Query.executeUpdate怎么用?Java Query.executeUpdate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.hibernate.Query的用法示例。


在下文中一共展示了Query.executeUpdate方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: deleteByIds

import org.hibernate.Query; //导入方法依赖的package包/类
@Override
public boolean deleteByIds(List<Integer> ids) {
    String hql = "delete User where id in (:ids)";
    Query query = getSession().createQuery(hql);
    query.setParameterList("ids", ids);
    return query.executeUpdate() == ids.size();
}
 
开发者ID:zhaoxi1988,项目名称:sjk,代码行数:8,代码来源:UserDaoImpl.java

示例2: deleteByPK

import org.hibernate.Query; //导入方法依赖的package包/类
@Override
public int deleteByPK(Session sess, int id) {
    Query query = sess.createQuery("delete from MarketApp where id=:id");
    query.setInteger("id", id);
    int rows = query.executeUpdate();
    return rows;
}
 
开发者ID:zhaoxi1988,项目名称:sjk,代码行数:8,代码来源:MarketAppDaoImpl.java

示例3: updateWeekDownload

import org.hibernate.Query; //导入方法依赖的package包/类
@Override
public int updateWeekDownload(Session session, int id) {
    String hql = "update App set LastWeekDelta =RealDownload - LastWeekDownload , LastWeekDownload = RealDownload where id = :id";
    Query query = session.createQuery(hql);
    query.setParameter("id", id);
    return query.executeUpdate();
}
 
开发者ID:zhaoxi1988,项目名称:sjk,代码行数:8,代码来源:AppDaoImpl.java

示例4: deleteByAppId

import org.hibernate.Query; //导入方法依赖的package包/类
@Override
public int deleteByAppId(Session session, int appId) {
    final String queryString = "delete AppAndTag where appId = :appId";
    Query query = session.createQuery(queryString);
    query.setParameter("appId", appId);
    return query.executeUpdate();
}
 
开发者ID:zhaoxi1988,项目名称:sjk,代码行数:8,代码来源:AppAndTagDaoImpl.java

示例5: updateHide

import org.hibernate.Query; //导入方法依赖的package包/类
@Override
public int updateHide(Session sess, List<Integer> ids) {
    String hql = "update App set Hidden = 1 where id in (:ids)";
    Query query = sess.createQuery(hql);
    query.setParameterList("ids", ids);
    int num = query.executeUpdate();
    if (ids != null && ids.size() == num) {
        appHistory4IndexDaoImpl.updateAppStatus2Del(ids);
    }
    return num;
}
 
开发者ID:zhaoxi1988,项目名称:sjk,代码行数:12,代码来源:AppDaoImpl.java

示例6: deleteByAppId

import org.hibernate.Query; //导入方法依赖的package包/类
@Override
public int deleteByAppId(Session session, int appId) {
    final String queryString = "delete MoAppAndTag where appId = :appId";
    Query query = session.createQuery(queryString);
    query.setParameter("appId", appId);
    return query.executeUpdate();
}
 
开发者ID:zhaoxi1988,项目名称:sjk,代码行数:8,代码来源:MoAppAndTagDaoImpl.java

示例7: updateAppStatus2Del

import org.hibernate.Query; //导入方法依赖的package包/类
/**
 * 设置appStatus 状态 为可删除 状态 3,索引状态 indexStatus为 -1
 */
@Override
public int updateAppStatus2Del(List<Integer> ids) {
    String hql = "update AppHistory4Index set appStatus=3,indexStatus=-1,lastOpTime=:lastOpTime where appId in (:appIds)";
    Query query = this.getSession().createQuery(hql);
    query.setParameterList("appIds", ids);
    query.setTimestamp("lastOpTime", new Date());

    return query.executeUpdate();

}
 
开发者ID:zhaoxi1988,项目名称:sjk,代码行数:14,代码来源:AppHistory4IndexDaoImpl.java

示例8: deleteByAppIdAndTagType

import org.hibernate.Query; //导入方法依赖的package包/类
@Override
public int deleteByAppIdAndTagType(List<Integer> appIds, short tagType) {
    String queryString = "delete AppAndTag where appId in (:appIds) and tagType = :tagType";
    Query query = getSession().createQuery(queryString);
    query.setParameterList("appIds", appIds);
    query.setParameter("tagType", tagType);
    return query.executeUpdate();
}
 
开发者ID:zhaoxi1988,项目名称:sjk,代码行数:9,代码来源:AppAndTagDaoImpl.java

示例9: deleteNotExistsApp

import org.hibernate.Query; //导入方法依赖的package包/类
@Override
public int deleteNotExistsApp(Session session) {
    StringBuilder hql = new StringBuilder("delete from Rollinfo where not exists (");
    hql.append(" select 1 from App x");
    hql.append(" where x.id = appId");
    hql.append(")");
    Query query = session.createQuery(hql.toString());
    int effected = query.executeUpdate();
    return effected;
}
 
开发者ID:zhaoxi1988,项目名称:sjk,代码行数:11,代码来源:RollinfoDaoImpl.java

示例10: updateShow

import org.hibernate.Query; //导入方法依赖的package包/类
@Override
public int updateShow(List<Integer> ids) {
    String hql = "update MoMixFeatured set Hidden = 0 where id in (:ids)";
    Query query = getSession().createQuery(hql);
    query.setParameterList("ids", ids);
    return query.executeUpdate();
}
 
开发者ID:zhaoxi1988,项目名称:sjk,代码行数:8,代码来源:MoMixFeaturedDaoImpl.java

示例11: editCatalog

import org.hibernate.Query; //导入方法依赖的package包/类
@Override
public int editCatalog(List<Integer> ids, short catalog, int subCatalog) {
    String hql = "update App set catalog = :catalog , subCatalog = :subCatalog , auditCatalog = 1 where id in (:ids)";
    Query query = getSession().createQuery(hql);
    query.setParameterList("ids", ids);
    query.setParameter("catalog", catalog);
    query.setParameter("subCatalog", subCatalog);
    return query.executeUpdate();
}
 
开发者ID:zhaoxi1988,项目名称:sjk,代码行数:10,代码来源:AppDaoImpl.java

示例12: updateDayDownload

import org.hibernate.Query; //导入方法依赖的package包/类
@Override
public int updateDayDownload(Session session, int id) {
    String hql = "update App set LastDayDelta =RealDownload - LastDayDownload , LastDayDownload = RealDownload where id = :id";
    Query query = session.createQuery(hql);
    query.setParameter("id", id);
    return query.executeUpdate();
}
 
开发者ID:zhaoxi1988,项目名称:sjk,代码行数:8,代码来源:AppDaoImpl.java

示例13: delete

import org.hibernate.Query; //导入方法依赖的package包/类
@Override
public int delete(int id) {
    Query query = getSession().createQuery("delete from MoMixFeatured where id=:id");
    query.setInteger("id", id);
    int rows = query.executeUpdate();
    return rows;
}
 
开发者ID:zhaoxi1988,项目名称:sjk,代码行数:8,代码来源:MoMixFeaturedDaoImpl.java

示例14: delete

import org.hibernate.Query; //导入方法依赖的package包/类
@Override
public int delete(List<Integer> appIds) {
    String hql = "delete Rollinfo where appId in (:ids)";
    Query query = getSession().createQuery(hql);
    query.setParameterList("ids", appIds);
    int effected = query.executeUpdate();
    return effected;
}
 
开发者ID:zhaoxi1988,项目名称:sjk,代码行数:9,代码来源:RollinfoDaoImpl.java

示例15: executeDataMigration

import org.hibernate.Query; //导入方法依赖的package包/类
@Override
protected void executeDataMigration(HibernateMigrationHelper helper, MigrationResult result, Session session)
{
	Query setDenyQuery = session.createQuery("UPDATE ItemDefinition SET denyDirectContribution = :value");
	setDenyQuery.setParameter("value", false);

	Query setDisabledQuery = session.createQuery("UPDATE FederatedSearch SET disabled = :value");
	setDisabledQuery.setParameter("value", false);

	setDenyQuery.executeUpdate();
	setDisabledQuery.executeUpdate();
}
 
开发者ID:equella,项目名称:Equella,代码行数:13,代码来源:AddExtraRemoteRepoColumns.java


注:本文中的org.hibernate.Query.executeUpdate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。