Package play.db.jpa

Examples of play.db.jpa.JPAPlugin


    renderJSON(worlds);
  }

  @play.db.jpa.NoTransaction
  public static void setup() {
    JPAPlugin plugin = play.Play.plugin(JPAPlugin.class);
    plugin.startTx(true);

    // clean out the old
    World.deleteAll();
    System.out.println("DELETED");
    // in with the new
    for (long i = 0; i <= TEST_DATABASE_ROWS; i++) {
      int randomNumber = random.nextInt(TEST_DATABASE_ROWS) + 1;
      new World(i, randomNumber).save();
      if (i % 100 == 0) {

        World.em().flush();
        World.em().clear();
        System.out.println("FLUSHED : " + i + "/" + TEST_DATABASE_ROWS);

      }
    }
    System.out.println("ADDED");
    plugin.closeTx(false);
  }
View Full Code Here

TOP

Related Classes of play.db.jpa.JPAPlugin

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.