本文整理汇总了Java中org.knowm.yank.Yank.insertSQLKey方法的典型用法代码示例。如果您正苦于以下问题:Java Yank.insertSQLKey方法的具体用法?Java Yank.insertSQLKey怎么用?Java Yank.insertSQLKey使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.knowm.yank.Yank
的用法示例。
在下文中一共展示了Yank.insertSQLKey方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: insertTest
import org.knowm.yank.Yank; //导入方法依赖的package包/类
public static long insertTest(Test test) {
if (test.getStatus() == null) {
LOGGER.warn("Test {} for build {} has no status. Setting the status to error.", test.getName(), test.getBuildId());
test.setStatus("error");
}
Object[] params = new Object[]{
test.getBuildId(),
test.getTaskId(),
test.getTestId(),
test.getName(),
test.getClassName(),
test.getStatus(),
test.durationInMillis()
};
long newId = Yank.insertSQLKey("INSERT_TEST", params);
LOGGER.debug("Inserted test {} for build {}", test.getName(), test.getBuildId());
return newId;
}
示例2: insertCustomValue
import org.knowm.yank.Yank; //导入方法依赖的package包/类
public static long insertCustomValue(CustomValue cv) {
Object[] params = new Object[]{
cv.getBuildId(),
cv.getKey(),
cv.getValue(),
};
long newId = Yank.insertSQLKey("INSERT_CUSTOM_VALUE", params);
LOGGER.debug("Inserted custom value with key {} for build {}", cv.getKey(), cv.getBuildId());
return newId;
}
示例3: insertBuild
import org.knowm.yank.Yank; //导入方法依赖的package包/类
public static long insertBuild(Build build) {
LOGGER.debug("Inserting build {} into the database.", build.getBuildId());
Object start;
Object finish;
if (SqlHelper.isMySql()) {
start = LocalDateTime.ofInstant(build.getTimer().getStartTime(), ZoneOffset.UTC);
finish = LocalDateTime.ofInstant(build.getTimer().getFinishTime(), ZoneOffset.UTC);
} else {
start = OffsetDateTime.ofInstant(build.getTimer().getStartTime(), ZoneId.of(build.getTimer().getTimeZoneId()));
finish = OffsetDateTime.ofInstant(build.getTimer().getFinishTime(), ZoneId.of(build.getTimer().getTimeZoneId()));
}
Object[] params = new Object[]{
build.getBuildId(),
build.getUserName(),
build.getRootProjectName(),
start,
finish,
build.getStatus(),
build.getTagsAsSingleString()
};
Long generatedId = Yank.insertSQLKey("INSERT_BUILD", params);
if (generatedId == 0) {
throw new RuntimeException("Unable to save build record for " + build.getBuildId());
}
return generatedId;
}