> > I'm curious: Why is this a "legacy"? Usually, the serial ID is the primary >> key. What would be a use-case not to do that? >> > > There's nothing wrong with serial IDs, but in this case it conveys no real > meaning. If the record is uniquely identified by a combination of N > fields, then the PKey should be a composite of those N fields. Having an > ID that just goes up and doesn't add value is something we're trying to > shift away from. >
I see. Classic natural key vs. surrogate key debate with a compromise to have both. I personally slightly favour natural keys as well when possible, although it's usually not possible: https://blog.jooq.org/2017/03/16/faster-sql-through-occasionally-choosing-natural-keys-over-surrogate-keys/ However, I'd pick between the two. If the primary key is a natural key, then I don't really see the point of an identity. Anyway, this is just me. jOOQ doesn't judge, so combining natural key with non-pk identity is perfectly valid from a jOOQ perspective. Please, let me know if you encounter any additional issues. Lukas -- 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]. For more options, visit https://groups.google.com/d/optout.
