Skip to content

Instantly share code, notes, and snippets.

View david-oc-miller's full-sized avatar

David Miller david-oc-miller

  • Armedia LLC
  • Haymarket, VA USA
View GitHub Profile
Thu Oct 15 14:08:53 UTC 2020
public class SaveItemService
{
@PersistenceContext
private EntityManager em;
@Transactional(propagation = Propagation.REQUIRED)
public Item save(Item toSave)
{
Item saved = em.merge(toSave);
return saved;
<bean id="saveItemController" class="com.sample.web.api.SaveItemController">
<property name="saveItemService" ref="saveItemService"/>
</bean>