java entity包_Java Entity类代码示例

import net.java.ao.Entity; //导入依赖的package包/类

@Override

public Void call()

{

try

{

long startTime = System.currentTimeMillis();

log.debug("Running SmartcommitOperation ... ");

changesetDao.forEachLatestChangesetsAvailableForSmartcommitDo(repository.getId(),

new String[] {ID, MESSAGE, NODE, AUTHOR_EMAIL, DATE}, // the columns used in the closure below

new ForEachChangesetClosure()

{

@Override

public void execute(Entity mapping)

{

ChangesetMapping changesetMapping = (ChangesetMapping) mapping;

log.debug("Processing message \n {} \n for smartcommits. Changeset id = {} node = {}.", new Object[]

{changesetMapping.getMessage(), changesetMapping.getID(), changesetMapping.getNode()});

// first mark as processed

changesetDao.markSmartcommitAvailability(changesetMapping.getID(), false);

// parse message

CommitCommands commands = commitMessageParser.parseCommitComment(changesetMapping.getMessage());

commands.setCommitDate(changesetMapping.getDate());

commands.setAuthorEmail(changesetMapping.getAuthorEmail());

// do commands

if (CollectionUtils.isNotEmpty(commands.getCommands()))

{

final CommandsResults commandsResults = smartcommitsService.doCommands(commands);

if (commandsResults.hasErrors())

{

Changeset changeset = changesetDao.getByNode(repository.getId(), changesetMapping.getNode());

if (changeset != null)

{

final String commitUrl = changesetService.getCommitUrl(repository, changeset);

List smartCommitErrors = new ArrayList();

for (String error : commandsResults.getAllErrors())

{

SmartCommitError sce = new SmartCommitError(changeset.getNode(), commitUrl, error);

smartCommitErrors.add(sce);

}

if (progress != null)

{

progress.setSmartCommitErrors(smartCommitErrors);

}

}

}

}

}

});

log.debug("Smartcommits for repository {} were processed in {} ms", repository.getId(), System.currentTimeMillis() - startTime);

}

catch (Exception e)

{

log.warn("Failed to process smartcommit operation. Cause = " + e.getClass() + " : " + e.getMessage());

}

return null;

}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值