use of eu.ggnet.dwoss.customer.ee.entity.Contact in project dwoss by gg-net.
the class PersistenceIT method testPersistence.
@Test
public void testPersistence() throws Exception {
utx.begin();
em.joinTransaction();
Customer c = GEN.makeCustomer();
em.persist(c);
utx.commit();
utx.begin();
em.joinTransaction();
CriteriaQuery<Customer> customerQ = em.getCriteriaBuilder().createQuery(Customer.class);
c = em.createQuery(customerQ.select(customerQ.from(Customer.class))).getSingleResult();
assertThat(c.getContacts()).describedAs("customer.getContacts()").isNotEmpty();
L.info("{}", c);
L.info("===== Contacts");
for (Contact contact : c.getContacts()) {
L.info(contact.toString());
L.info("===== - Communications");
for (Communication communication : contact.getCommunications()) {
L.info(communication.toString());
}
}
L.info("===== Companies");
for (Company company : c.getCompanies()) {
L.info(company.toString());
L.info("===== - Communications:");
for (Communication communication : company.getCommunications()) {
L.info(communication.toString());
}
}
L.info("===== MandatorMetaData");
for (MandatorMetadata man : c.getMandatorMetadata()) {
L.info(man.toString());
}
utx.commit();
}
use of eu.ggnet.dwoss.customer.ee.entity.Contact in project dwoss by gg-net.
the class ContactUpdateTryout method main.
public static void main(String[] args) {
CustomerGenerator gen = new CustomerGenerator();
Contact contact = gen.makeContact();
contact.setTitle("Dr.");
contact.getAddresses().add(gen.makeAddress());
contact.getAddresses().add(gen.makeAddress());
contact.getAddresses().add(gen.makeAddress());
contact.getCommunications().add(gen.makeCommunication());
contact.getCommunications().add(gen.makeCommunication());
contact.getCommunications().add(gen.makeCommunication());
JButton close = new JButton("Schliessen");
close.addActionListener(e -> Ui.closeWindowOf(close));
JButton editButton = new JButton("edit");
editButton.addActionListener(ev -> {
Ui.exec(() -> {
Ui.build().fxml().eval(() -> contact, ContactUpdateController.class).opt().ifPresent(System.out::println);
});
});
JButton addButton = new JButton("add");
addButton.addActionListener(ev -> {
Ui.exec(() -> {
Ui.build().fxml().eval(() -> new Contact(), ContactUpdateController.class).opt().ifPresent(System.out::println);
});
});
JPanel p = new JPanel();
p.add(editButton);
p.add(addButton);
p.add(close);
UiCore.startSwing(() -> p);
}
Aggregations