Hi Jurgen,
Thanks for the feedback. We needed a sanity check on this. Note that we already
implemented #5 ("compiled" entities) on master:
https://github.com/apache/cayenne/tree/master/cayenne/src/main/java/org/apache/cayenne/map/compiled
which stays split. So the goal of #4 is to produce a mapping that can be
directly translated to a split runtime model.
> Multiple “views” over the same table
That would require multiple entities so there will be table / column
duplication. So you may argue this case will become harder. Though copy/paste
in the Modeler and DB import should help. Personally, I can't imagine
maintaining a model without DB import these days anyways.
> Multi-table entities and flattened attributes/relationships
> These are genuinely useful. I’m assuming the plan is to keep the capability
> (an Entity can still pull attributes across relationship paths), just without
> the separate DbRelationship bookkeeping. Is that the direction?
Correct. You'd map a flattened path over a chain of existing paths. And then
mark the underlying paths and intermediate entities as "not a class property /
not a class".
> Seeing the full table structure
It should be possible in the UI. Here is an idea: a "DDL View" showing the
corresponding "CREATE TABLE" statement. I am hoping the overall UX would
actually improve once the model becomes less fragile as a result of the #4
change.
Thanks,
Andrus
> On Nov 12, 2026, at 11:50 AM, Jurgen Doll via dev <[email protected]>
> wrote:
>
> Hi Andrus
>
> I had to chew on item 4 a bit, i.e. the idea of collapsing Db vs Obj into a
> single Entity / Attribute / Relationship layer does make a lot of sense on
> paper and I can appreciate the appeal of cutting the mapping roughly in half.
> That said, coming from years of working only with Cayenne’s current
> dual-layer approach, a few practical concerns keep coming up for me. I’d be
> interested in your thoughts on how these would be handled:
> Multiple “views” over the same table
> Today it’s straightforward to have several ObjEntities that map different
> subsets of the same DbEntity. In a single-layer world, would we still be able
> to have lightweight projections / secondary mappings without repeating the
> column definitions? And if a column’s, name, type, or nullability changes,
> would that still be a single point of update?
>
> Multi-table entities and flattened attributes/relationships
> These are genuinely useful. I’m assuming the plan is to keep the capability
> (an Entity can still pull attributes across relationship paths), just without
> the separate DbRelationship bookkeeping. Is that the direction?
>
> Seeing the full table structure
> One thing I find useful sometimes is being able to look at a DbEntity and
> immediately see every column, the PK strategy, etc. In a unified model, would
> there still be a clear “this is the complete physical table” view, or would
> that information only be visible if some Entity happens to map all the
> columns?
>
> Can you please clarify how these things would be expressed in the new design.
> Thanks for all the ongoing work on Cayenne.
>
> Kind regards,
> Jurgen
>