本文整理汇总了Java中com.avaje.ebean.EbeanServer.save方法的典型用法代码示例。如果您正苦于以下问题:Java EbeanServer.save方法的具体用法?Java EbeanServer.save怎么用?Java EbeanServer.save使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.avaje.ebean.EbeanServer
的用法示例。
在下文中一共展示了EbeanServer.save方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: loadKundedbTestData
import com.avaje.ebean.EbeanServer; //导入方法依赖的package包/类
private void loadKundedbTestData(Map<String, List<Object>> data) {
// load initial test data
EbeanServer kundedb = Ebean.getServer("kundedb");
if (kundedb.find(Kunde.class).findRowCount() == 0) {
List<Object> kunder = data.get("kunder");
List<Object> datafiler = data.get("datafiler");
List<Object> kundefiler = data.get("kundefiler");
List<Object> posisjoner = data.get("posisjoner");
List<Object> produkter = data.get("produkter");
if ( kunder !=null && kunder.size() > 0 )kundedb.save(kunder);
if ( datafiler !=null && datafiler.size() > 0 )kundedb.save(datafiler);
if ( kundefiler!=null && kundefiler.size() > 0 )kundedb.save(kundefiler);
if ( posisjoner!=null && posisjoner.size() > 0 )kundedb.save(posisjoner);
if ( produkter !=null && produkter.size() > 0 )kundedb.save(produkter);
}
}
示例2: loadQubaTestData
import com.avaje.ebean.EbeanServer; //导入方法依赖的package包/类
private void loadQubaTestData(Map<String, List<Object>> data) {
// load initial test data
EbeanServer quba = Ebean.getServer("quba");
if (quba.find(QubaStation.class).findRowCount() == 0) {
List<Object> stations = data.get("stations");
quba.save(stations);
List<Object> stationProfiles = data.get("stationprofiles");
quba.save(stationProfiles);
List<Object> subjectives = data.get("subjectives");
// Lage ny subjective for Gullfaks for i dag, slik at vi har noe å
// sende til produksjon i web-klienten
QubaSubjective subjective = new QubaSubjective();
DateTime now = DateTime.now(PoseidonService.getTimeZone());
DateTime noon = now.withTime(12,0,0,0);
subjective.pk.stationid = 3L;
subjective.pk.pindexid = 31;
subjective.pk.runDate = noon.toDate();
subjective.pk.validDate= subjective.pk.runDate;
subjective.pk.levelid = 0;
subjectives.add(subjective);
quba.save(subjectives);
}
}
示例3: loadDistdbTestData
import com.avaje.ebean.EbeanServer; //导入方法依赖的package包/类
private void loadDistdbTestData(Map<String, List<Object>> data) {
// load initial test data
EbeanServer dist = Ebean.getServer("dist");
if (dist.find(DistLocation.class).findRowCount() == 0) {
List<Object> locations = data.get("locations");
dist.save(locations);
}
}
示例4: save
import com.avaje.ebean.EbeanServer; //导入方法依赖的package包/类
public T save(T item) {
EbeanServer ws = this.daConfig.getWriteEbeanServer();
ws.beginTransaction();
ws.save(item);
ws.commitTransaction();
return item;
}