title: JPA/Hibernate remove entity not working
body: <p>I'm using a JPA interface to Hibernate, and I've written some simple code to load an entity from the database and then remove (delete) it.  All of my merge calls to insert and update entities are working perfectly, but when I try to remove an entity, Hibernate doesn't delete it from the database, and no exception is thrown.  I've included the relevant code below:</p>
  
  <p>Primary method:</p>
  
  <pre><code>/**
   * Accept an invite that was sent to you.
   * 
   * @param inviteId
   * @return XML model of the EventMember.
   */
  @RequestMapping(value="/invites/accept.rest")
  public ModelAndView acceptInvite(@RequestParam final long inviteId) {
      final EventInvite invite = eventInviteDAO.find(EventInvite.class, eventInviteId);
  
      EventMember eventMember = new EventMember();
      eventMember.setEvent(invite.getEvent());
      eventMember.setUser(invite.getUser());
      eventMember = eventMemberDAO.store(eventMember);
  
      eventInviteDAO.remove(invite);
  
      return getXMLModelAndView("eventMember", eventMember);
  }
  </code></pre>
  
  <p>AbstractJpaDao class (inherited by all DAO classes):</p>
  
  <pre><code>public abstract class AbstractJpaDao&lt;T&gt; implements JpaDao&lt;T&gt; {
      abstract public EntityManager getEntityManager();
  
      public &lt;T&gt; T find(Class&lt;T&gt; entityClass, Object primaryKey) {
          return getEntityManager().find(entityClass, primaryKey);
      }
  
      @Transactional(isolation = Isolation.DEFAULT, propagation = Propagation.REQUIRED)
      public T store(final T objectToPersist) {
          T result = getEntityManager().merge(objectToPersist);
          return result;
      }
  
      @Transactional(isolation = Isolation.DEFAULT, propagation = Propagation.REQUIRED)
      public void remove(final T objectToDelete) {
          getEntityManager().remove(objectToDelete);
      }
  }
  </code></pre>
  
  <p>EventInvite domain class:</p>
  
  <pre><code>@Entity
  @Table(name = "TEventInvite")
  public class EventInvite implements Serializable {
      private static final long serialVersionUID = 1L;
  
      @Column(name = "EventInviteID", nullable = false)
      @Basic(fetch = FetchType.EAGER)
      @Id
      @GeneratedValue(strategy = GenerationType.IDENTITY)
      private long eventInviteId;
  
      @ManyToOne(fetch = FetchType.EAGER)
      @JoinColumns( { @JoinColumn(name = "EventID", referencedColumnName = "EventID", nullable = false) })
      private Event event;
  
      @Column(name = "Email")
      @Basic(fetch = FetchType.EAGER)
      private String email;
  
      @Temporal(TemporalType.TIMESTAMP)
      @Column(name = "CreateDate", nullable = false)
      @Basic(fetch = FetchType.EAGER)
      private Calendar createDate;
  
      @ManyToOne(fetch = FetchType.EAGER)
      @JoinColumns( { @JoinColumn(name = "UserID", referencedColumnName = "UserID") })
      private User user;
  
      public void setEventInviteId(long eventInviteId) {
          this.eventInviteId = eventInviteId;
      }
  
      public long getEventInviteId() {
          return this.eventInviteId;
      }
  
      public Event getEvent() {
          return event;
      }
  
      public void setEvent(Event event) {
          this.event = event;
      }
  
      public void setEmail(String email) {
          this.email = email;
      }
  
      public String getEmail() {
          return this.email;
      }
  
      public void setCreateDate(Calendar createDate) {
          this.createDate = createDate;
      }
  
      public Calendar getCreateDate() {
          return this.createDate;
      }
  
      public void setUser(User user) {
          this.user = user;
      }
  
      public User getUser() {
          return user;
      }
  
      @Override
      public int hashCode() {
          final int prime = 31;
          int result = 1;
          result = prime * result
                  + ((createDate == null) ? 0 : createDate.hashCode());
          result = prime * result + ((email == null) ? 0 : email.hashCode());
          result = prime * result + ((event == null) ? 0 : event.hashCode());
          result = prime * result + ((user == null) ? 0 : user.hashCode());
          return result;
      }
  
      @Override
      public boolean equals(Object obj) {
          if (this == obj)
              return true;
          if (obj == null)
              return false;
          if (getClass() != obj.getClass())
              return false;
          EventInvite other = (EventInvite) obj;
          if (createDate == null) {
              if (other.createDate != null)
                  return false;
          } else if (!createDate.equals(other.createDate))
              return false;
          if (email == null) {
              if (other.email != null)
                  return false;
          } else if (!email.equals(other.email))
              return false;
          if (event == null) {
              if (other.event != null)
                  return false;
          } else if (!event.equals(other.event))
              return false;
          if (user == null) {
              if (other.user != null)
                  return false;
          } else if (!user.equals(other.user))
              return false;
          return true;
      }
  
  }
  </code></pre>
  
  <p>Any ideas about what the problem might be or how to debug it?</p>