Package com.avaje.ebean

Examples of com.avaje.ebean.EbeanServer.beginTransaction()


    Product prod1 = createProduct(100,"apples");
    server.insert(prod1);
    Product prod2 = createProduct(101, "bananas");
    server.insert(prod2);
   
    server.beginTransaction();
    // effectively load these into the persistence context
    server.find(Product.class, prod1.getId());
    server.find(Product.class, prod2.getId());
   
    server.delete(Product.class, Arrays.asList(prod1.getId(), prod2.getId()));
View Full Code Here


  @Test
  public void test() {
   
    EbeanServer server = Ebean.getServer(null);
   
    server.beginTransaction();
    try {
     
      EBasic bean1 = new EBasic();
      bean1.setName("hello");
     
View Full Code Here

  @Test
  public void test() {

    EbeanServer server = Ebean.getServer(null);

    Transaction transaction = server.beginTransaction();
    try {
      transaction.setBatchMode(true);
      transaction.setBatchSize(20);
      for (int i = 0; i < 10000; i++) {
        EBasic dumbModel = new EBasic();
View Full Code Here

  public void test() throws InterruptedException, ExecutionException {
   

    EbeanServer server = Ebean.getServer(null);

    Transaction transaction = server.beginTransaction();
    try {
      transaction.setBatchMode(true);
      transaction.setBatchSize(20);
      for (int i = 0; i < 87; i++) {
        EBasic dumbModel = new EBasic();
View Full Code Here

    boolean dirty = beanState.isDirty();
    Assert.assertTrue(dirty);
   
    server.save(b2);

    server.beginTransaction();
    try {
        EMain b3 = server.find(EMain.class, b.getId());
        Assert.assertEquals("ABC", b3.getEmbeddable().getDescription());
    } finally {
        server.endTransaction();
View Full Code Here

   
    UTDetail detail1 = new UTDetail("one", 12, 30D);
    UTDetail detail2 = new UTDetail("two", 11, 30D);
    UTDetail detail3 = new UTDetail("three", 8, 30D);
   
    Transaction txn = ebeanServer.beginTransaction();
    try {
      txn.setBatchMode(true);
      ebeanServer.save(detail1);
      ebeanServer.save(detail2);
      ebeanServer.save(detail3);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.