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


Java SQLInsertClause.execute方法代码示例

本文整理汇总了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;
}
 
开发者ID:agwlvssainokuni,项目名称:springapp,代码行数:20,代码来源:AsyncProcessStoreImpl.java

示例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")));
}
 
开发者ID:agwlvssainokuni,项目名称:springapp,代码行数:19,代码来源:LocalDateTypeTest.java

示例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());
}
 
开发者ID:agwlvssainokuni,项目名称:springapp,代码行数:17,代码来源:AsyncProcessStoreImpl.java

示例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")));
}
 
开发者ID:agwlvssainokuni,项目名称:springapp,代码行数:19,代码来源:LocalDateTimeTypeTest.java

示例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")));
}
 
开发者ID:agwlvssainokuni,项目名称:springapp,代码行数:19,代码来源:LocalDateTimeTypeTest.java

示例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")));
}
 
开发者ID:agwlvssainokuni,项目名称:springapp,代码行数:19,代码来源:LocalTimeTypeTest.java

示例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;
}
 
开发者ID:agwlvssainokuni,项目名称:springapp,代码行数:20,代码来源:AsyncProcessStoreImpl.java

示例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();
}
 
开发者ID:solita,项目名称:kansalaisaloite,代码行数:14,代码来源:InitiativeDaoImpl.java

示例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;
}
 
开发者ID:agwlvssainokuni,项目名称:springapp,代码行数:29,代码来源:AsyncProcessStoreImpl.java

示例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());
	}
}
 
开发者ID:agwlvssainokuni,项目名称:springapp,代码行数:28,代码来源:AsyncProcessStoreImpl.java

示例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();

}
 
开发者ID:solita,项目名称:kansalaisaloite,代码行数:11,代码来源:TestHelper.java

示例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);
	}
}
 
开发者ID:agwlvssainokuni,项目名称:springapp,代码行数:15,代码来源:MessageStoreImpl.java

示例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);
}
 
开发者ID:agwlvssainokuni,项目名称:springapp,代码行数:12,代码来源:LocalDateTimeTypeTest.java

示例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);
}
 
开发者ID:agwlvssainokuni,项目名称:springapp,代码行数:8,代码来源:MessageStoreImpl.java

示例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);
}
 
开发者ID:agwlvssainokuni,项目名称:springapp,代码行数:12,代码来源:LocalTimeTypeTest.java


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