Some more info would probably help us to understand what you're doing.
Is this a java enum? Or just a group of java constants?
How are you storing it in the DB? With the string value of the enum
constants? Or with the ordinal value or int constant value?
I believe the answers are:
1) Yes, you have to set it yourself, which is true of all non-primitive
fields.
2) If you set to the wrong value
- If using enums, it should blow up when you read the row back from
the DB
- If using int constants, it will just be wrong, but no exceptions.
On Tue, Oct 1, 2019 at 3:23 PM Tony Giaccone <[email protected]> wrote:
> I have two objects, that are based on the same table. I want to
> differentiate them by using a qualifier.
>
> I'm using a qualifer that looks like accountType = AccountType.hdaccount
>
> where hdaccount is one of the enumerated values.
>
> When i create an object of this type, the field is set to null. Is that
> typical? Do I have to explicitly set it myself, if so what happens if I set
> it to the wrong value?
>
> Tony Giaccone
>