use of com.infiniteskills.data.entities.Transaction in project microservices by pwillhan.
the class Application method createNewBeltPurchase.
private static Transaction createNewBeltPurchase() {
Transaction beltPurchase = new Transaction();
beltPurchase.setTitle("Dress Belt");
beltPurchase.setAmount(new BigDecimal("50.00"));
beltPurchase.setClosingBalance(new BigDecimal("0.00"));
beltPurchase.setCreatedBy("Kevin Bowersox");
beltPurchase.setCreatedDate(new Date());
beltPurchase.setInitialBalance(new BigDecimal("0.00"));
beltPurchase.setLastUpdatedBy("Kevin Bowersox");
beltPurchase.setLastUpdatedDate(new Date());
beltPurchase.setNotes("New Dress Belt");
beltPurchase.setTransactionType("Debit");
return beltPurchase;
}
use of com.infiniteskills.data.entities.Transaction in project microservices by pwillhan.
the class HqlApplication method main.
public static void main(String[] args) {
SessionFactory factory = null;
Session session = null;
org.hibernate.Transaction tx = null;
try {
factory = HibernateUtil.getSessionFactory();
session = factory.openSession();
tx = session.beginTransaction();
Query query = session.createQuery("select t from Transaction t");
List<Transaction> transactions = query.list();
for (Transaction t : transactions) {
System.out.println(t.getTitle());
}
tx.commit();
} catch (Exception e) {
tx.rollback();
} finally {
session.close();
factory.close();
}
}
use of com.infiniteskills.data.entities.Transaction in project microservices by pwillhan.
the class JpqlApplication method main.
@SuppressWarnings("unchecked")
public static void main(String[] args) {
EntityManagerFactory factory = null;
EntityManager em = null;
EntityTransaction tx = null;
try {
factory = Persistence.createEntityManagerFactory("infinite-finances");
em = factory.createEntityManager();
tx = em.getTransaction();
tx.begin();
TypedQuery<Transaction> query = em.createQuery("from Transaction t order by t.title", Transaction.class);
List<Transaction> transactions = query.getResultList();
for (Transaction t : transactions) {
System.out.println(t.getTitle());
}
tx.commit();
} catch (Exception e) {
tx.rollback();
} finally {
em.close();
factory.close();
}
}
Aggregations