use of org.apache.karaf.examples.jpa.Booking in project karaf by apache.
the class BookingServiceImpl method add.
@Override
public void add(String flight, String customer) {
Booking booking = new Booking();
booking.setCustomer(customer);
booking.setFlight(flight);
jpaTemplate.tx(TransactionType.RequiresNew, entityManager -> {
entityManager.persist(booking);
entityManager.flush();
});
}
use of org.apache.karaf.examples.jpa.Booking in project karaf by apache.
the class BookingServiceImpl method add.
@Transactional(Transactional.TxType.REQUIRES_NEW)
@Override
public void add(String flight, String customer) {
Booking booking = new Booking();
booking.setCustomer(customer);
booking.setFlight(flight);
entityManager.persist(booking);
}
use of org.apache.karaf.examples.jpa.Booking in project karaf by apache.
the class BookingServiceImpl method remove.
@Transactional(Transactional.TxType.REQUIRES_NEW)
@Override
public void remove(Long id) {
Booking booking = get(id);
entityManager.remove(booking);
}
use of org.apache.karaf.examples.jpa.Booking in project karaf by apache.
the class BookingServiceImpl method add.
@Override
public void add(String flight, String customer) {
Booking booking = new Booking();
booking.setCustomer(customer);
booking.setFlight(flight);
jpaTemplate.tx(TransactionType.RequiresNew, entityManager -> {
entityManager.persist(booking);
entityManager.flush();
});
}
Aggregations