本文整理汇总了Java中com.mysema.query.sql.dml.SQLInsertClause.execute方法的典型用法代码示例。如果您正苦于以下问题:Java SQLInsertClause.execute方法的具体用法?Java SQLInsertClause.execute怎么用?Java SQLInsertClause.execute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.mysema.query.sql.dml.SQLInsertClause
的用法示例。
在下文中一共展示了SQLInsertClause.execute方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createCommand
import com.mysema.query.sql.dml.SQLInsertClause; //导入方法依赖的package包/类
@Transactional(value = "jtaTransactionManager", propagation = REQUIRES_NEW)
public long createCommand(String launcherId, LocalDateTime dtm, String description, String command, String... args) {
long asyncId = createAsyncProcess(launcherId, description, AsyncType.COMMAND, dtm);
SQLInsertClause insert = queryFactory.insert(apc);
insert.set(apc.asyncId, asyncId);
insert.set(apc.command, adjustSize(command, apc.command));
long count = insert.execute();
checkState(count == 1L, "failed to create QAsyncProcessCommand: asyncId=%s, command=%s", asyncId, command);
for (String arg : args) {
long c = queryFactory.insert(apca).set(apca.asyncId, asyncId)
.set(apca.argument, adjustSize(arg, apca.argument)).execute();
checkState(c == 1L, "failed to create QAsyncProcessCommandArg: asyncId=%s, arg=%s", asyncId, arg);
}
return asyncId;
}
示例2: testSaveAndLoad_plus1d
import com.mysema.query.sql.dml.SQLInsertClause; //导入方法依赖的package包/类
@Test
public void testSaveAndLoad_plus1d() {
LocalDate orig = LocalDate.now().plusDays(1);
SQLInsertClause insert = queryFactory.insert(vd);
insert.set(vd.dt, orig);
long count = insert.execute();
assertEquals(1L, count);
SQLQuery query = queryFactory.from(vd);
LocalDate result = query.uniqueResult(vd.dt);
assertEquals(orig, result);
assertEquals(
Integer.valueOf(1),
jdbcOperations.queryForObject("SELECT COUNT(*) FROM verify_datetime WHERE dt=?", Integer.class,
orig.toString("yyyy-MM-dd")));
}
示例3: finishCommand
import com.mysema.query.sql.dml.SQLInsertClause; //导入方法依赖的package包/类
@Transactional(propagation = REQUIRES_NEW)
@Override
public void finishCommand(long asyncId, LocalDateTime dtm, AsyncStatus status, CommandResult result) {
finishAsyncProcess(asyncId, dtm, status);
SQLInsertClause insert = queryFactory.insert(apcr);
insert.set(apcr.asyncId, asyncId);
insert.set(apcr.exitValue, result.getExitValue());
insert.set(apcr.stdout, adjustSize(result.getStdout(), apcr.stdout));
insert.set(apcr.stderr, adjustSize(result.getStderr(), apcr.stderr));
long count = insert.execute();
checkState(count == 1L,
"failed to create QAsyncProcessCommandResult: asyncId=%s, exitValue=%s, stdout=%s, stderr=%s", asyncId,
result.getExitValue(), result.getStdout(), result.getStderr());
}
示例4: testSaveAndLoad
import com.mysema.query.sql.dml.SQLInsertClause; //导入方法依赖的package包/类
@Test
public void testSaveAndLoad() {
LocalDateTime orig = LocalDateTime.now();
SQLInsertClause insert = queryFactory.insert(vd);
insert.set(vd.dtm, orig);
long count = insert.execute();
assertEquals(1L, count);
SQLQuery query = queryFactory.from(vd);
LocalDateTime result = query.uniqueResult(vd.dtm);
assertEquals(orig, result);
assertEquals(
Integer.valueOf(1),
jdbcOperations.queryForObject("SELECT COUNT(*) FROM verify_datetime WHERE dtm=?", Integer.class,
orig.toString("yyyy-MM-dd HH:mm:ss.SSS")));
}
示例5: testSaveAndLoad_plus1d
import com.mysema.query.sql.dml.SQLInsertClause; //导入方法依赖的package包/类
@Test
public void testSaveAndLoad_plus1d() {
LocalDateTime orig = LocalDateTime.now().plusDays(1);
SQLInsertClause insert = queryFactory.insert(vd);
insert.set(vd.dtm, orig);
long count = insert.execute();
assertEquals(1L, count);
SQLQuery query = queryFactory.from(vd);
LocalDateTime result = query.uniqueResult(vd.dtm);
assertEquals(orig, result);
assertEquals(
Integer.valueOf(1),
jdbcOperations.queryForObject("SELECT COUNT(*) FROM verify_datetime WHERE dtm=?", Integer.class,
orig.toString("yyyy-MM-dd HH:mm:ss.SSS")));
}
示例6: testSaveAndLoad_plus1h
import com.mysema.query.sql.dml.SQLInsertClause; //导入方法依赖的package包/类
@Test
public void testSaveAndLoad_plus1h() {
LocalTime orig = LocalTime.now().plusHours(1);
SQLInsertClause insert = queryFactory.insert(vd);
insert.set(vd.tm, orig);
long count = insert.execute();
assertEquals(1L, count);
SQLQuery query = queryFactory.from(vd);
LocalTime result = query.uniqueResult(vd.tm);
assertEquals(orig, result);
assertEquals(
Integer.valueOf(1),
jdbcOperations.queryForObject("SELECT COUNT(*) FROM verify_datetime WHERE tm=?", Integer.class,
orig.toString("HH:mm:ss.SSS")));
}
示例7: createCommand
import com.mysema.query.sql.dml.SQLInsertClause; //导入方法依赖的package包/类
@Transactional(value = "jtaTransactionManager", propagation = REQUIRES_NEW)
public long createCommand(String launcherId, LocalDateTime dtm, String description, String command, String... args) {
long asyncId = createAsyncProcess(launcherId, description, AsyncType.COMMAND, dtm);
SQLInsertClause insert = queryFactory.insert(apc);
insert.set(apc.asyncId, asyncId);
insert.set(apc.command, adjustSize(command, apc.command));
long count = insert.execute();
checkState(count == 1L, "failed to create %s: asyncId=%s, command=%s", apc.getTableName(), asyncId, command);
for (String arg : args) {
long c = queryFactory.insert(apca).set(apca.asyncId, asyncId)
.set(apca.argument, adjustSize(arg, apca.argument)).execute();
checkState(c == 1L, "failed to create %s: asyncId=%s, arg=%s", apca.getTableName(), asyncId, arg);
}
return asyncId;
}
示例8: insertAuthor
import com.mysema.query.sql.dml.SQLInsertClause; //导入方法依赖的package包/类
@Override
@Transactional(readOnly=false)
public void insertAuthor(Long initiativeId, Long userId, Author author) {
SQLInsertClause insert = queryFactory.insert(qAuthor)
.set(qAuthor.userId, userId)
.set(qAuthor.initiativeId, initiativeId);
populateAuthor(insert, author);
insert.set(qAuthor.confirmed, CURRENT_TIME);
insert.execute();
}
示例9: createFileProcess
import com.mysema.query.sql.dml.SQLInsertClause; //导入方法依赖的package包/类
@Transactional(value = "jtaTransactionManager", propagation = REQUIRES_NEW)
@Override
public long createFileProcess(String launcherId, LocalDateTime dtm, String description, String name,
String originalFilename, String contentType, long size, String handlerName, String... args) {
long asyncId = createAsyncProcess(launcherId, description, AsyncType.FILE, dtm);
SQLInsertClause insert = queryFactory.insert(apf);
insert.set(apf.asyncId, asyncId);
insert.set(apf.paramName, adjustSize(name, apf.paramName));
insert.set(apf.originalFilename, adjustSize(originalFilename, apf.originalFilename));
insert.set(apf.contentType, adjustSize(contentType, apf.contentType));
insert.set(apf.fileSize, size);
insert.set(apf.handlerName, adjustSize(handlerName, apf.handlerName));
long count = insert.execute();
checkState(
count == 1L,
"failed to create QAsyncProcessFile: asyncId=%s, paramName=%s, originalFilename=%s, contentType=%s, fileSize=%s, handlerName=%s",
asyncId, name, originalFilename, contentType, size, handlerName);
for (String arg : args) {
long c = queryFactory.insert(apfa).set(apfa.asyncId, asyncId)
.set(apfa.argument, adjustSize(arg, apfa.argument)).execute();
checkState(c == 1L, "failed to create QAsyncProcessFileArg: asyncId=%s, arg=%s", asyncId, arg);
}
return asyncId;
}
示例10: finishFileProcess
import com.mysema.query.sql.dml.SQLInsertClause; //导入方法依赖的package包/类
@Transactional(propagation = REQUIRES_NEW)
@Override
public void finishFileProcess(long asyncId, LocalDateTime dtm, AsyncStatus status, FileProcessResult result) {
finishAsyncProcess(asyncId, dtm, status);
SQLInsertClause insert = queryFactory.insert(apfr);
insert.set(apfr.asyncId, asyncId);
insert.set(apfr.totalCount, result.getTotalCount());
insert.set(apfr.okCount, result.getOkCount());
insert.set(apfr.ngCount, result.getNgCount());
long count = insert.execute();
checkState(count == 1L, "failed to create %s: asyncId=%s, totalCount=%s, okCount=%s, ngCount=%s",
apfr.getTableName(), asyncId, result.getTotalCount(), result.getOkCount(), result.getNgCount());
List<FileRecordInfo> list = (result.getNgRecordInfoList() == null ? new ArrayList<FileRecordInfo>() : result
.getNgRecordInfoList());
for (FileRecordInfo r : list) {
if (r.isOk()) {
continue;
}
long c = queryFactory.insert(apfrd).set(apfrd.asyncId, asyncId).set(apfrd.recordNumber, r.getNumber())
.set(apfrd.description, adjustSize(r.getDescription(), apfrd.description)).execute();
checkState(c == 1L, "failed to create %s: asyncId=%s, recordNumber=%s, description=%s",
apfrd.getTableName(), asyncId, r.getNumber(), r.getDescription());
}
}
示例11: createSupport
import com.mysema.query.sql.dml.SQLInsertClause; //导入方法依赖的package包/类
@Transactional(readOnly = false)
public void createSupport(Long initiativeId, LocalDate supportVoteDate) {
SQLInsertClause insert = queryFactory.insert(QSupportVote.supportVote)
.set(QSupportVote.supportVote.created, supportVoteDate.toDateTime(LocalTime.now()))
.set(QSupportVote.supportVote.details, "anyDetails")
.set(QSupportVote.supportVote.initiativeId, initiativeId)
.set(QSupportVote.supportVote.supportid, RandomStringUtils.random(64));
insert.execute();
}
示例12: createMailRcpt
import com.mysema.query.sql.dml.SQLInsertClause; //导入方法依赖的package包/类
private void createMailRcpt(long mailId, String rcptType, List<String> rcptAddr) {
if (rcptAddr == null || rcptAddr.isEmpty()) {
return;
}
for (String addr : rcptAddr) {
SQLInsertClause insert = queryFactory.insert(mr);
insert.set(mr.mailId, mailId);
insert.set(mr.rcptType, rcptType);
insert.set(mr.rcptAddr, addr);
long c = insert.execute();
checkState(c == 1L, "failed to create QMailRcpt: mailId=%s, rcptType=%s, rcptAddr=%s", mailId, rcptType,
addr);
}
}
示例13: testSaveAndLoad_null
import com.mysema.query.sql.dml.SQLInsertClause; //导入方法依赖的package包/类
@Test
public void testSaveAndLoad_null() {
SQLInsertClause insert = queryFactory.insert(vd);
long count = insert.execute();
assertEquals(1L, count);
SQLQuery query = queryFactory.from(vd);
LocalDateTime result = query.uniqueResult(vd.dtm);
assertNull(result);
}
示例14: createMailQueue
import com.mysema.query.sql.dml.SQLInsertClause; //导入方法依赖的package包/类
private void createMailQueue(long mailId, LocalDateTime scheduledAt) {
SQLInsertClause insert = queryFactory.insert(mq);
insert.set(mq.mailId, mailId);
insert.set(mq.scheduledAt, scheduledAt);
long count = insert.execute();
checkState(count == 1L, "failed to create QMailQueue: mailId=%s, scheduledAt=%s", mailId, scheduledAt);
}
示例15: testSaveAndLoad_null
import com.mysema.query.sql.dml.SQLInsertClause; //导入方法依赖的package包/类
@Test
public void testSaveAndLoad_null() {
SQLInsertClause insert = queryFactory.insert(vd);
long count = insert.execute();
assertEquals(1L, count);
SQLQuery query = queryFactory.from(vd);
LocalTime result = query.uniqueResult(vd.tm);
assertNull(result);
}