Is there any way to make the `ordinal` field of an...
# getting-started
d
Is there any way to make the
ordinal
field of an enum start by 2 instead of 0? I'm using a third party ksp parser that uses the ordinal for something that I need to skip the first three numbers for...
j
Could you please elaborate? What is the 3rd party parser using the ordinal for? Couldn't it be a property instead?
There's either using the enum name or the ordinal for the fields value in the database... and the field's value starts from 2
j
Ouch.. that looks wrong from a DB evolution standpoint. Both strategies look pretty bad: using the name is sensitive to renaming, and using the ordinal is sensitive to re-ordering or addition of values in the middle. I wonder why they don't have a property-based strategy, which would be more robust
👍 2
👍🏼 1
d
Yeah... they have mappers and converters... but it was easier to write a value class wrapper that translates between the value and the enum...