use of org.jboss.as.test.integration.jpa.hibernate.entity.Ticket in project wildfly by wildfly.
the class EntityTest method oneToManyCreate.
public Customer oneToManyCreate() throws Exception {
Ticket t = new Ticket();
t.setNumber("111");
Customer c = new Customer();
Set<Ticket> tickets = new HashSet<Ticket>();
tickets.add(t);
t.setCustomer(c);
c.setTickets(tickets);
session.save(c);
return c;
}
use of org.jboss.as.test.integration.jpa.hibernate.entity.Ticket in project wildfly by wildfly.
the class EntityTestCase method testOneToMany.
@Test
@InSequence(1)
public void testOneToMany() throws Exception {
EntityTest test = lookup("EntityTest", EntityTest.class);
Customer c = test.oneToManyCreate();
assertNotNull(c);
assertNotNull(c.getTickets());
Set<Ticket> tickets = c.getTickets();
assertTrue(tickets.size() > 0);
assertNotNull(c);
assertNotNull(c.getTickets());
tickets = c.getTickets();
assertTrue(tickets.size() > 0);
}
Aggregations