deltaspike-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Andraschko <andraschko.tho...@gmail.com>
Subject Re: ds data repository method suggestion
Date Wed, 20 Aug 2014 07:57:39 GMT
Sounds good - create an feature request please.


2014-08-19 18:00 GMT+02:00 Juliano Marques <julianomqs@gmail.com>:

> 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