this works, but is there a better way?
"Robert A. Decker" <[email protected]> Tue, 7 Apr 2026 13:48:29 +0200
| Newsgroups | gmane.comp.java.cayenne.user |
|---|---|
| Message-ID | <[email protected]> |
I'm using single-table inheritance with the 'type' column determining =
the subclass with a Qualifier in the model:
AiSystemPrompt (abstract)
AiSystemPromptSummarization (Qualifier =
type=3D'AiSystemPromptSummarization')
This query works:
List<AiJob> jobs =3D ObjectSelect.query(AiJob.class)
=
.where(AiJob.AI_SYSTEM_PROMPT.dot(AiSystemPrompt.TYPE).eq("AiSystemPromptS=
ummarization"))
.select(context);
But I don't like that I'm hardcoding the subclass =
("AiSystemPromptSummarization") and searching against the TYPE property.
Is there a way to do this using the attributes I have in the cayenne =
model? (abstract superclass with concrete subclass using the qualifier =
set in the entity model)
I looked at BaseProperty and a couple of others in =
org.apache.cayenne.exp.property but don't see it....
Rob=