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.

Reply via email to