本文整理汇总了Java中com.avaje.ebean.Ebean.execute方法的典型用法代码示例。如果您正苦于以下问题:Java Ebean.execute方法的具体用法?Java Ebean.execute怎么用?Java Ebean.execute使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.avaje.ebean.Ebean
的用法示例。
在下文中一共展示了Ebean.execute方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: clearAllData
import com.avaje.ebean.Ebean; //导入方法依赖的package包/类
public static Result clearAllData () {
String createDdl = "";
String dropDdl = "";
String evolutionContent;
try {
byte[] encoded = Files.readAllBytes(Paths.get(Play.application().path().getPath() + "/conf/evolutions/default/1.sql"));
evolutionContent = new String(encoded, "UTF-8");
String[] splittedEvolutionContent = evolutionContent.split("# --- !Ups");
String[] upsDowns = splittedEvolutionContent[1].split("# --- !Downs");
createDdl = upsDowns[0];
dropDdl = upsDowns[1];
Ebean.execute(Ebean.createCallableSql(dropDdl));
Ebean.execute(Ebean.createCallableSql(createDdl));
return ok();
} catch (Exception e) {
appLogger.error("Error clearing db data", e);
return internalServerError("Error clearing db data");
}
}
示例2: processFiles
import com.avaje.ebean.Ebean; //导入方法依赖的package包/类
public static Boolean processFiles(String uniq) {
String sql = getUpdateSqlByDbType();
SqlUpdate updateProcess = Ebean.createSqlUpdate(sql);
updateProcess.setParameter("uniq", uniq);
updateProcess.setParameter("status", UploadStatus.UPLOADED.getType());
updateProcess.setParameter("qty", GlobalParams.LIMIT_PROCCESS_FILES);
return Ebean.execute(updateProcess) == 1;
}
示例3: createStatusSQL
import com.avaje.ebean.Ebean; //导入方法依赖的package包/类
private static Boolean createStatusSQL(String sql, String id, int status, String jobId, String response) {
SqlUpdate updateStatus = Ebean.createSqlUpdate(sql);
updateStatus.setParameter("id", id);
updateStatus.setParameter("status", status);
if(!jobId.isEmpty()) {
updateStatus.setParameter("job", jobId);
}
if(!response.isEmpty()) {
updateStatus.setParameter("response", response);
}
return Ebean.execute(updateStatus) == 1;
}