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


Java SQLInsertClause.set方法代码示例

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


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

示例1: createMailLog

import com.mysema.query.sql.dml.SQLInsertClause; //导入方法依赖的package包/类
private long createMailLog(final String launcherId, final LocalDateTime launchedAt, final String messageName,
		final LocalDateTime scheduledAt, final String from, final String subject, final String body) {
	final QMailLog a = new QMailLog("a");
	SqlInsertWithKeyCallback<Long> callback = new SqlInsertWithKeyCallback<Long>() {
		@Override
		public Long doInSqlInsertWithKeyClause(SQLInsertClause insert) {
			insert.set(a.launchedBy, launcherId);
			insert.set(a.launchedAt, launchedAt);
			insert.set(a.mailStatus, FlagCode.FALSE.code());
			insert.set(a.messageName, messageName);
			insert.set(a.scheduledAt, scheduledAt);
			insert.set(a.fromAddr, from);
			insert.set(a.subject, subject);
			insert.set(a.body, body);
			return insert.executeWithKey(Long.class);
		}
	};
	Long id = queryDslJdbcOperations.insertWithKey(a, callback);
	checkState(
			id != null,
			"failed to create QMailLog: launchedBy={0}, launchedAt={1}, mailStatus={2}, messageName={3}, scheduledAt={4}, fromAddr={5}, subject={6}, body={7}",
			launcherId, launchedAt, FlagCode.FALSE.code(), messageName, scheduledAt, from, subject, body);
	return id.longValue();
}
 
开发者ID:agwlvssainokuni,项目名称:sqlapp,代码行数:25,代码来源:MessageStoreImpl.java

示例2: 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

示例3: create

import com.mysema.query.sql.dml.SQLInsertClause; //导入方法依赖的package包/类
@Transactional
@Override
public Long create(BasicEx10Form form) {
	SQLInsertClause insert = qf.insert(et1);
	if (StringUtils.isNotEmpty(form.getText10())) {
		insert.set(et1.text10, form.getText10());
	}
	if (StringUtils.isNotEmpty(form.getText100())) {
		insert.set(et1.text100, form.getText100());
	}
	insert.set(et1.int64, form.getInt64());
	insert.set(et1.decimal1, form.getDecimal1());
	insert.set(et1.decimal3, form.getDecimal3());
	insert.set(et1.dt, form.getDt());
	insert.set(et1.tm, form.getTm());
	insert.set(et1.dtm, form.getDtm());
	return insert.executeWithKey(et1.id);
}
 
开发者ID:agwlvssainokuni,项目名称:springapp,代码行数:19,代码来源:BasicEx10ServiceImpl.java

示例4: testSaveAndLoad

import com.mysema.query.sql.dml.SQLInsertClause; //导入方法依赖的package包/类
@Test
public void testSaveAndLoad() {

	LocalDate orig = LocalDate.now();
	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

示例5: 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

示例6: createMailLog

import com.mysema.query.sql.dml.SQLInsertClause; //导入方法依赖的package包/类
private long createMailLog(String launcherId, LocalDateTime launchedAt, String messageName,
		LocalDateTime scheduledAt, String from, String replyTo, String subject, String body) {
	SQLInsertClause insert = queryFactory.insert(ml);
	insert.set(ml.launchedBy, launcherId);
	insert.set(ml.launchedAt, launchedAt);
	insert.set(ml.mailStatus, FlagCode.FALSE.code());
	insert.set(ml.messageName, messageName);
	insert.set(ml.scheduledAt, scheduledAt);
	insert.set(ml.fromAddr, from);
	insert.set(ml.replyToAddr, replyTo);
	insert.set(ml.subject, subject);
	insert.set(ml.body, body);
	Long id = insert.executeWithKey(Long.class);
	checkState(
			id != null,
			"failed to create QMailLog: launchedBy=%s, launchedAt=%s, mailStatus=%s, messageName=%s, scheduledAt=%s, fromAddr=%s, replyToAddr=%s, subject=%s, body=%s",
			launcherId, launchedAt, FlagCode.FALSE.code(), messageName, scheduledAt, from, replyTo, subject, body);
	return id.longValue();
}
 
开发者ID:agwlvssainokuni,项目名称:springapp,代码行数:20,代码来源:MessageStoreImpl.java

示例7: 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

示例8: 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

示例9: 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 %s: asyncId=%s, exitValue=%s, stdout=%s, stderr=%s",
			apcr.getTableName(), asyncId, result.getExitValue(), result.getStdout(), result.getStderr());
}
 
开发者ID:agwlvssainokuni,项目名称:springapp,代码行数:16,代码来源:AsyncProcessStoreImpl.java

示例10: insertInvitation

import com.mysema.query.sql.dml.SQLInsertClause; //导入方法依赖的package包/类
private Long insertInvitation(Long initiativeId, Invitation invitation) {
    SQLInsertClause insert = queryFactory.insert(qInvitation);

    insert.set(qInvitation.initiativeId, initiativeId);
    insert.set(qInvitation.email, invitation.getEmail());
    insert.set(qInvitation.role, invitation.getRole());
    
    return insert.executeWithKey(qInvitation.id);
}
 
开发者ID:solita,项目名称:kansalaisaloite,代码行数:10,代码来源:InitiativeDaoImpl.java

示例11: 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

示例12: createAsyncProcess

import com.mysema.query.sql.dml.SQLInsertClause; //导入方法依赖的package包/类
private long createAsyncProcess(String launcherId, String description, AsyncType asyncType, LocalDateTime dtm) {
	SQLInsertClause insert = queryFactory.insert(ap);
	insert.set(ap.launchedBy, launcherId);
	insert.set(ap.description, adjustSize(description, ap.description));
	insert.set(ap.asyncType, asyncType.code());
	insert.set(ap.asyncStatus, AsyncStatus.LAUNCHING.code());
	insert.set(ap.registeredAt, dtm);
	Long id = insert.executeWithKey(Long.class);
	checkState(id != null,
			"failed to create %s: launchedBy=%s, description=%s, asyncType=%s, asyncStatus=%s, registeredAt=%s",
			ap.getTableName(), launcherId, description, asyncType.code(), AsyncStatus.LAUNCHING.code(), dtm);
	return id.longValue();
}
 
开发者ID:agwlvssainokuni,项目名称:springapp,代码行数:14,代码来源:AsyncProcessStoreImpl.java

示例13: 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

示例14: 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 %s: asyncId=%s, paramName=%s, originalFilename=%s, contentType=%s, fileSize=%s, handlerName=%s",
			apf.getTableName(), 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 %s: asyncId=%s, arg=%s", apfa.getTableName(), asyncId, arg);
	}

	return asyncId;
}
 
开发者ID:agwlvssainokuni,项目名称:springapp,代码行数:29,代码来源:AsyncProcessStoreImpl.java

示例15: createSignupRequest

import com.mysema.query.sql.dml.SQLInsertClause; //导入方法依赖的package包/类
@Transactional
@Override
public long createSignupRequest(String mailAddr, String token, LocalDateTime appliedAt) {
	SQLInsertClause insert = queryFactory.insert(a);
	insert.set(a.mailAddr, mailAddr);
	insert.set(a.token, token);
	insert.set(a.appliedAt, appliedAt);
	Long id = insert.executeWithKey(Long.class);
	checkState(id != null, "failed to create %s: mailAddr=%s, token=%s, appliedAt=%s", a.getTableName(), mailAddr,
			token, appliedAt);
	return id.longValue();
}
 
开发者ID:agwlvssainokuni,项目名称:springapp,代码行数:13,代码来源:SignupRequestHelperImpl.java


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