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


Java EbeanServer.save方法代码示例

本文整理汇总了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);

  }
}
 
开发者ID:metno,项目名称:poseidon-rest,代码行数:20,代码来源:Global.java

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

  }
}
 
开发者ID:metno,项目名称:poseidon-rest,代码行数:30,代码来源:Global.java

示例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);
  }
}
 
开发者ID:metno,项目名称:poseidon-rest,代码行数:9,代码来源:Global.java

示例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;
}
 
开发者ID:shailesh17,项目名称:spring-boot-ebean-starter,代码行数:8,代码来源:BaseRepository.java


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