well I think EMDelegate isa workaround and shouldn't be visible
(excepted for advanced cases - persist is not ;)).

default as insertOrUpdate is nice but insertOnly is important so it
should be part of the API and this is not directly linked to isNew
IMHO (you can hack isNew to make it working but semantically it is not
the same).

About isNew: we can introduce a spi by provider and fallback on
current impl if provider is unknown, it would certainly be better if
we still have issues with it.

wdyt?



Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau


2014-10-02 14:24 GMT+02:00 Thomas Hug <[email protected]>:
> Thought about that too, but wouldn't that start to be confusing? We have
> save, insert plus EMDelegate with persist and merge?
> Alternatively we might add something to override the isNew strategy, or
> check whether the ID is a @GeneratedValue. wdyt?
>
> On Thu, Oct 2, 2014 at 11:34 AM, Romain Manni-Bucau <[email protected]>
> wrote:
>
>> @Thomas: we can maybe add it to DS itself: "insert"?
>>
>>
>> Romain Manni-Bucau
>> Twitter: @rmannibucau
>> Blog: http://rmannibucau.wordpress.com/
>> LinkedIn: http://fr.linkedin.com/in/rmannibucau
>> Github: https://github.com/rmannibucau
>>
>>
>> 2014-10-02 10:58 GMT+02:00 Thomas Hug <[email protected]>:
>> > I'd not try overriding save - the way the called method is resolved is
>> not
>> > predictable if the method signature is the same. Adding a new method
>> should
>> > do it though.
>> >
>> > On Thu, Oct 2, 2014 at 10:12 AM, hwaastad <[email protected]> wrote:
>> >
>> >> Hi,
>> >> and thanks for answering.
>> >>
>> >> I'm extending the abstractentityrepository so I'll start testing
>> override
>> >> on
>> >> the save method or just adding another method.
>> >> If that does'nt suit my needs, I'll have a closer look at the
>> >> entitymanagerdelegate.
>> >>
>> >> thanks again,
>> >> br hw
>> >>
>> >>
>> >>
>> >> --
>> >> View this message in context:
>> >>
>> http://apache-deltaspike-incubator-discussions.2316169.n4.nabble.com/Repository-save-duplicate-key-tp4659067p4659069.html
>> >> Sent from the Apache DeltaSpike Incubator Discussions mailing list
>> archive
>> >> at Nabble.com.
>> >>
>>

Reply via email to