deltaspike-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Juliano Marques <juliano...@gmail.com>
Subject ds data repository method suggestion
Date Tue, 19 Aug 2014 16:00:09 GMT
Hi,

It will be nice if EntityRepository has a method like:

public void attachAndRemove(Entity entity) {
    if (entityManager.contains(entity)) {
        entityManager.remove(entity);

    } else {
        entityManager.remove(entityManager.merge(entity));
    }
}

This method will be useful to handle "java.lang.IllegalArgumentException:
Removing a detached instance" exceptions.

Regards,

*Juliano M.*

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message