I've summarised it here as well:
https://github.com/jOOQ/jOOQ/issues/8705#issuecomment-2429525742

A log statement (assuming a log table) might not have a primary key at all,
in case of which option 1 really does appear weird. Though, option 1 is
consistent with https://github.com/jOOQ/jOOQ/issues/17487, where we simply
include/exclude columns from the implementation.

On Tue, Oct 22, 2024 at 5:03 PM Simon Martinelli <[email protected]>
wrote:

> That’s a tricky question.But I would say they are non-equal.
> You could have two objects with the same content, but you want to store
> them as two records.
> For example, you have a log statement that happened at the same time and
> with the same content.
>
> That’s what I usually implement when using JPA.
>
>
> On 22 Oct 2024, at 16:51, Lukas Eder <[email protected]> wrote:
>
> Simon,
>
> What's your opinion on the equality of POJOs that don't have a value for a
> primary key yet (e.g. an identity)? There are at least these 3 strategies:
>
> - All not-yet-stored objects are equal
> - All not-yet-stored objects are non-equal (unless they have the same
> identity)
> - Not-yet-stored objects are equal if their contents are equal (current
> behaviour)
>
> My preference would be to treat them all as non-equal
>
>
> On Tue, Oct 22, 2024 at 4:42 PM Lukas Eder <[email protected]> wrote:
>
>>
>> *POJOs*
>>>> equals/hashCode use all attributes. Why?
>>>> If the underlaying database table has a Primary or a Unique key only
>>>> those attributes should be used.
>>>>
>>>
>>> See:
>>> https://github.com/jOOQ/jOOQ/issues/8705
>>>
>>
>> A similar request has come up on that issue where users wish to exclude
>> certain columns from the equals() / hashCode() implementation (e.g.
>> created_at, and other, similar audit columns). That could be implemented in
>> addition to filters for primary keys:
>> https://github.com/jOOQ/jOOQ/issues/17487
>>
>> I'll do both for jOOQ 3.20.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "jOOQ User Group" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jooq-user/CAB4ELO7J6VXBSVfq4ObiAc%2BLVA6o0JdFaBZteqQTdU_yQ%2BHJbA%40mail.gmail.com
> <https://groups.google.com/d/msgid/jooq-user/CAB4ELO7J6VXBSVfq4ObiAc%2BLVA6o0JdFaBZteqQTdU_yQ%2BHJbA%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "jOOQ User Group" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jooq-user/C9399175-44C2-4440-A2EF-5DC46AB0FF2E%40gmail.com
> <https://groups.google.com/d/msgid/jooq-user/C9399175-44C2-4440-A2EF-5DC46AB0FF2E%40gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups "jOOQ 
User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jooq-user/CAB4ELO6BoABQQsWMh8giXJSP7JU5us6zvrRNEsiphsKg6P59GQ%40mail.gmail.com.

Reply via email to