Examples of persist()


Examples of org.hibernate.Session.persist()

        sanne.setName( "Sanne" );

        sanne.getProjects().add( project );
        project.getMembers().add( sanne );

        session.persist( sanne );

        transaction.commit();

        return project.getRevision();
      }
View Full Code Here

Examples of org.hibernate.classic.Session.persist()

    fol.setName("books");
    doc.setOwner(o);
    doc.setFolder(fol);
    doc.setSizeKb(SIZE_IN_KB);
    fol.getDocuments().add(doc);
    s.persist(o);
    s.persist(fol);
    t.commit();
    s.close();

    s = getFactory().openSession();
View Full Code Here

Examples of org.hibernate.ejb.HibernateEntityManager.persist()

                currentTheme.setActive(false);
                hem.merge(currentTheme);
            }
        }

        hem.persist(theme);
    }

    @Override
    public YFTheme getCurrentTheme() {
        HibernateEntityManager hem = (HibernateEntityManager) em.getDelegate();
View Full Code Here

Examples of org.hibernate.ogm.OgmSession.persist()

    EntityWithObjectIdAndEmbeddable entity = new EntityWithObjectIdAndEmbeddable();
    AnEmbeddable anEmbeddable = new AnEmbeddable( "a very nice string", null );
    entity.setAnEmbeddable( anEmbeddable );

    // when
    session.persist( entity );

    tx.commit();
    session.clear();
    tx = session.beginTransaction();
View Full Code Here

Examples of org.hibernate.search.FullTextSession.persist()

    final Session session = openSession();
    Transaction transaction = session.beginTransaction();
    final FullTextSession fts = Search.getFullTextSession( session );
    final Insurance insurance = new Insurance();
    insurance.setName( "Macif" );
    fts.persist( insurance );
    transaction.commit();

    fts.clear();

    transaction = fts.beginTransaction();
View Full Code Here

Examples of org.hibernate.search.jpa.FullTextEntityManager.persist()

  public void testHibernateSearchJPAAPIUsage() throws Exception {
    getTransactionManager().begin();
    final FullTextEntityManager ftem = Search.getFullTextEntityManager( getFactory().createEntityManager() );
    final Insurance insurance = new Insurance();
    insurance.setName( "Macif" );
    ftem.persist( insurance );
    getTransactionManager().commit();

    ftem.clear();

    getTransactionManager().begin();
View Full Code Here

Examples of org.internna.ossmoney.model.Account.persist()

    account.setCreated(account.getLastModified());
    account.setOwner(UserDetails.findCurrentUser());
    account.setAccountType(getAccountType(register));
    account.setOpened(DateUtils.getMidnight(register.getDate()));
    account.setInitialBalance(new BigDecimal(register.getAmount()));
    account.persist();
    register.setPayee(account.getName());
    getOrCreatePayee(register, account);
    return account;
  }
View Full Code Here

Examples of org.internna.ossmoney.model.AccountTransaction.persist()

    transaction.getAccountTransaction().persist();
    if (commision != 0D) {
      BigDecimal charge = new BigDecimal(commision).abs();
      Subcategory chargeCategory = Subcategory.findBySubcategory("category.bankcharges", user);
      AccountTransaction bankCharge = AccountTransaction.createInstance(account, Payee.findByFinancialInstitution(account.getHeldAt()), chargeCategory, charge, DateUtils.nextDate(transaction.getAccountTransaction().getOperationDate()), null);
      bankCharge.persist();
    }
  }

}
View Full Code Here

Examples of org.internna.ossmoney.model.Bill.persist()

      bill.setDescription(description);
      bill.setPayee(Payee.findPayee(payee));
      bill.setOwner(UserDetails.findCurrentUser());
      bill.setCurrency(new Locale(locale[0], locale[1], ""));
      bill.setCategory(Subcategory.findSubcategory(subcategory));
      bill.persist();
    }

    @RequestMapping("/pay/{id}")
    public String pay(@PathVariable Long id, ModelMap modelMap) {
      UserDetails user = UserDetails.findCurrentUser();
View Full Code Here

Examples of org.internna.ossmoney.model.Category.persist()

      Category category = Category.findByCategory(register.getCategory());
      if (category == null) {
        category = new Category();
        category.setCategory(register.getCategory());
        category.setIncome(register.getAmount() > 0 ? Boolean.TRUE : Boolean.FALSE);
        category.persist();
      }
      subcategory = new Subcategory();
      subcategory.setOwner(user);
      subcategory.setParentCategory(category);
      subcategory.setCategory(register.getSubcategory());
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.