Re: entity Qualifiers and enums

Andrus Adamchik <[email protected]>
Newsgroups gmane.comp.java.cayenne.user
Message-ID <[email protected]>

> On Oct 1, 2019, at 11: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?

At least with numeric qualifier values, Cayenne injects qualifier values based on the object type right inside "context.newObject(..)". I am looking at the unit tests now. We have this functionality and it is working.

Not sure we've tested this with enums though. Could be a bug, as the expectation is that it should work with all kinds of constants.

Andrus
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.