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


Java SQLUpdateClause.execute方法代码示例

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


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

示例1: updateInitiative

import com.mysema.query.sql.dml.SQLUpdateClause; //导入方法依赖的package包/类
@Override
@Transactional(readOnly=false)
public void updateInitiative(InitiativeManagement initiative, Long userId, boolean basic, boolean extra) {
    Assert.notNull(initiative, "initiative");
    Assert.notNull(userId, "userId");

    Long initiativeId = initiative.getId();
    Assert.notNull(initiativeId, "initiative.id");

    SQLUpdateClause update = queryFactory.update(qInitiative);
    populateInitiative(update, initiative, userId, basic, extra);
    update.where(qInitiative.id.eq(initiative.getId()));
    
    if (update.execute() != 1) {
        throw new NotFoundException(qInitiative.getTableName(), initiative.getId());
    } 
}
 
开发者ID:solita,项目名称:kansalaisaloite,代码行数:18,代码来源:InitiativeDaoImpl.java

示例2: updateLink

import com.mysema.query.sql.dml.SQLUpdateClause; //导入方法依赖的package包/类
private void updateLink(Link link, Long initiativeId) {
    Long linkId = link.getId();
    Assert.notNull(linkId, "link.id");

    SQLUpdateClause update = queryFactory
            .update(qInitiativeLink)
            .where(
                    qInitiativeLink.id.eq(linkId),
                    qInitiativeLink.initiativeId.eq(initiativeId) // Defensive... 
                );
    populateLink(update, link);
    
    if (update.execute() != 1) {
        throw new NotFoundException(qInitiativeLink.getTableName(), linkId);
    }
}
 
开发者ID:solita,项目名称:kansalaisaloite,代码行数:17,代码来源:InitiativeDaoImpl.java

示例3: updateUnsentInvitation

import com.mysema.query.sql.dml.SQLUpdateClause; //导入方法依赖的package包/类
private void updateUnsentInvitation(Long initiativeId, Invitation invitation) {
    if (invitation.getSent() == null) {
        Long invitationId = invitation.getId();
        Assert.notNull(invitationId, "invitation.id");

        SQLUpdateClause update = queryFactory
                .update(qInvitation)
                .where(
                        qInvitation.id.eq(invitationId),
                        qInvitation.initiativeId.eq(initiativeId) // Defensive... 
                    );
        update.set(qInvitation.email, invitation.getEmail());
        
        if (update.execute() != 1) {
            throw new NotFoundException(qInitiativeLink.getTableName(), invitationId);
        }
    }
}
 
开发者ID:solita,项目名称:kansalaisaloite,代码行数:19,代码来源:InitiativeDaoImpl.java

示例4: updateInvitationSent

import com.mysema.query.sql.dml.SQLUpdateClause; //导入方法依赖的package包/类
@Override
@Transactional(readOnly=false)
public void updateInvitationSent(Long initiativeId, Long invitationId, String invitationCode) {
    Assert.notNull(initiativeId, "initiativeId");
    Assert.notNull(invitationId, "invitationId");
    Assert.notNull(invitationCode, "invitationCode");

    SQLUpdateClause update = queryFactory
            .update(qInvitation)
            .where(
                    qInvitation.id.eq(invitationId),
                    qInvitation.initiativeId.eq(initiativeId),  // Defensive... 
                    qInvitation.sent.isNull()
                );
    update.set(qInvitation.sent, CURRENT_TIME);
    update.set(qInvitation.invitationcode, invitationCode);
    
    if (update.execute() != 1) {
        throw new NotFoundException(qInvitation.getTableName(), invitationId);
    }
}
 
开发者ID:solita,项目名称:kansalaisaloite,代码行数:22,代码来源:InitiativeDaoImpl.java

示例5: saveAndUnlock

import com.mysema.query.sql.dml.SQLUpdateClause; //导入方法依赖的package包/类
@Override
public void saveAndUnlock(final String numberName, final long current) {
	SQLUpdateClause update = queryFactory.update(nm);
	update.set(nm.currentValue, current);
	update.set(nm.lockVersion, nm.lockVersion.add(1));
	update.where(nm.name.eq(numberName), nm.deletedFlg.eq(DeletedFlag.NOT_DELETED.code()));
	long count = update.execute();
	checkState(count == 1, "Failed to update %s: name=%s, currentValue=%s, count=%s", nm.getTableName(),
			numberName, current, count);
}
 
开发者ID:agwlvssainokuni,项目名称:springapp,代码行数:11,代码来源:NumberingStoreImpl.java

示例6: finishMessage

import com.mysema.query.sql.dml.SQLUpdateClause; //导入方法依赖的package包/类
@Override
public void finishMessage(long messageId) {

	SQLUpdateClause update = queryFactory.update(ml);
	update.set(ml.mailStatus, FlagCode.TRUE.code());
	update.set(ml.sentAt, bizDateTime.now());
	update.set(ml.lockVersion, ml.lockVersion.add(1));
	update.where(ml.id.eq(messageId), ml.deletedFlg.eq(DeletedFlag.NOT_DELETED.code()));
	long count = update.execute();
	checkState(count == 1L, "failed to update QMailLog: id=%s, mailStatus=%s", messageId, FlagCode.TRUE.code());

	long c = queryFactory.delete(mq)
			.where(mq.mailId.eq(messageId), mq.deletedFlg.eq(DeletedFlag.NOT_DELETED.code())).execute();
	checkState(c == 1L, "failed to delete QMailQueue: mailId=%s", messageId);
}
 
开发者ID:agwlvssainokuni,项目名称:springapp,代码行数:16,代码来源:MessageStoreImpl.java

示例7: updateSendToParliament

import com.mysema.query.sql.dml.SQLUpdateClause; //导入方法依赖的package包/类
@Override
@Transactional(readOnly = false)
public void updateSendToParliament(Long initiativeId, SendToParliamentData data) {
    SQLUpdateClause update = queryFactory.update(qInitiative)
            .set(qInitiative.parliamentidentifier, data.getParliamentIdentifier())
            .set(qInitiative.parliamentsenttime, data.getParliamentSentTime())
            .set(qInitiative.parliamenturl, data.getParliamentURL())
            .set(qInitiative.state, InitiativeState.DONE)
            .set(qInitiative.statedate, CURRENT_TIME)
            .where(qInitiative.id.eq(initiativeId));

    if (update.execute() != 1) {
        throw new NotFoundException(qInitiative.getTableName(), initiativeId);
    }
}
 
开发者ID:solita,项目名称:kansalaisaloite,代码行数:16,代码来源:InitiativeDaoImpl.java

示例8: endInitiative

import com.mysema.query.sql.dml.SQLUpdateClause; //导入方法依赖的package包/类
@Override
public void endInitiative(Long initiativeId, LocalDate lastRunningDate) {
    SQLUpdateClause update = queryFactory.update(qInitiative)
            .set(qInitiative.enddate, lastRunningDate)
            .where(qInitiative.id.eq(initiativeId));

    if (update.execute() != 1) {
        throw new NotFoundException(qInitiative.getTableName(), initiativeId);
    }
}
 
开发者ID:solita,项目名称:kansalaisaloite,代码行数:11,代码来源:InitiativeDaoImpl.java

示例9: clearConfirmations

import com.mysema.query.sql.dml.SQLUpdateClause; //导入方法依赖的package包/类
@Override
@Transactional(readOnly=false)
public void clearConfirmations(Long initiativeId, Long userId) {
    Expression<DateTime> confirmed = new CaseBuilder()
        .when(qAuthor.userId.eq(userId))
        .then(CURRENT_TIME)
        .otherwise(NULL_TIME);

    SQLUpdateClause update = queryFactory.update(qAuthor)
        .set(qAuthor.confirmed, confirmed)
        .set(qAuthor.confirmationrequestsent, NULL_TIME)
        .where(qAuthor.initiativeId.eq(initiativeId));

    update.execute();
}
 
开发者ID:solita,项目名称:kansalaisaloite,代码行数:16,代码来源:InitiativeDaoImpl.java

示例10: updateConfirmationRequestSent

import com.mysema.query.sql.dml.SQLUpdateClause; //导入方法依赖的package包/类
@Override
@Transactional(readOnly=false)
public void updateConfirmationRequestSent(Long initiativeId, Long userId) {
    SQLUpdateClause update = queryFactory.update(qAuthor)
            .set(qAuthor.confirmationrequestsent, CURRENT_TIME)
            .where(qAuthor.initiativeId.eq(initiativeId), qAuthor.userId.eq(userId));

    update.execute();
}
 
开发者ID:solita,项目名称:kansalaisaloite,代码行数:10,代码来源:InitiativeDaoImpl.java

示例11: confirmAuthor

import com.mysema.query.sql.dml.SQLUpdateClause; //导入方法依赖的package包/类
@Override
@Transactional(readOnly=false)
public void confirmAuthor(Long initiativeId, Long userId) {
    SQLUpdateClause update = queryFactory.update(qAuthor)
            .set(qAuthor.confirmed, CURRENT_TIME)
            .where(qAuthor.initiativeId.eq(initiativeId), qAuthor.userId.eq(userId));

    if (update.execute() != 1) {
        throw new NotFoundException("author", initiativeId + ":" + userId);
    }
}
 
开发者ID:solita,项目名称:kansalaisaloite,代码行数:12,代码来源:InitiativeDaoImpl.java

示例12: updateAuthor

import com.mysema.query.sql.dml.SQLUpdateClause; //导入方法依赖的package包/类
@Override
@Transactional(readOnly=false)
public void updateAuthor(Long initiativeId, Long userId, Author author) {
    SQLUpdateClause update = queryFactory
            .update(qAuthor)
            .where(qAuthor.initiativeId.eq(initiativeId), qAuthor.userId.eq(userId));
    
    populateAuthor(update, author);
    
    if (update.execute() != 1) {
        throw new NotFoundException("author", initiativeId + ":" + userId);
    }
}
 
开发者ID:solita,项目名称:kansalaisaloite,代码行数:14,代码来源:InitiativeDaoImpl.java

示例13: incrementSupportCount

import com.mysema.query.sql.dml.SQLUpdateClause; //导入方法依赖的package包/类
@Override
@Transactional(readOnly=false)
public void incrementSupportCount(Long initiativeId) {
    // Increment Initiative.supportCount
    SQLUpdateClause update = queryFactory.update(qInitiative)
            .set(qInitiative.supportcount, qInitiative.supportcount.add(1))
            .where(qInitiative.id.eq(initiativeId));
    update.execute();
}
 
开发者ID:solita,项目名称:kansalaisaloite,代码行数:10,代码来源:SupportVoteDaoImpl.java

示例14: finishAsyncProcess

import com.mysema.query.sql.dml.SQLUpdateClause; //导入方法依赖的package包/类
private void finishAsyncProcess(long asyncId, LocalDateTime dtm, AsyncStatus status) {
	SQLUpdateClause update = queryFactory.update(ap);
	update.set(ap.asyncStatus, status.code());
	update.set(ap.finishedAt, dtm);
	update.set(ap.updatedAt, currentTimestamp(LocalDateTime.class));
	update.set(ap.lockVersion, ap.lockVersion.add(1));
	update.where(ap.id.eq(asyncId));
	update.where(ap.deletedFlg.eq(DeletedFlag.NOT_DELETED.code()));
	long count = update.execute();
	checkState(count == 1L, "failed to update QAsyncProcess: id=%s, asyncStatus=%s, finishedAt=%s, count=%s",
			asyncId, status.code(), dtm, count);
}
 
开发者ID:agwlvssainokuni,项目名称:springapp,代码行数:13,代码来源:AsyncProcessStoreImpl.java

示例15: setUserRoles

import com.mysema.query.sql.dml.SQLUpdateClause; //导入方法依赖的package包/类
@Override
public void setUserRoles(Long userId, boolean vrk, boolean om) {
    Assert.notNull(userId, "userId");
    SQLUpdateClause update = queryFactory.update(qUser);
    update.set(qUser.vrk, vrk);
    update.set(qUser.om, om);
    update.where(qUser.id.eq(userId));
    update.execute();
}
 
开发者ID:solita,项目名称:kansalaisaloite,代码行数:10,代码来源:UserDaoImpl.java


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