yeah, not sure too saveNew maybe?

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 15:21 GMT+02:00 Thomas Hug <[email protected]>:
> Agree that it has its uses, but I'm more worried about the naming
> (insertOrUpdate vs. insert is far more clear than save vs. insert). Any
> good suggestions based on save are welcome :)
> SPI sounds good too. We already do provider detection for the query string
> extraction.
>
> On Thu, Oct 2, 2014 at 2:30 PM, Romain Manni-Bucau <[email protected]>
> wrote:
>
>> 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