本文整理匯總了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();
}
示例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;
}
示例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();
}
示例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();
}
示例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;
}
示例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();
}
示例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();
}
示例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();
}
示例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;
}
示例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();
}
示例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();
}
示例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();
}
示例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;
}
示例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;
}
示例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();
}