cayenne-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Maik Musall <>
Subject 4.1 templates with relationships
Date Tue, 17 Jul 2018 13:48:37 GMT

I'm experimenting with 4.1 and field-based DataObjects. I noticed, using the standard 4.1
server superclass template, that the fields that cover relationships aren't narrowly typed
but are simply specified as Object, which is apparently necessary because they may get populated
with a ToOneFault or a ToManyFault.

Is there really no way to get these types more specific? One of my experimentation goals was
to use Gson to serialize DOs from and to JSON, and the field-based approach would make that
very simple, were it not for the relationships.

I also noticed that the template specifies the field scope as protected. Isn't that unnecessarily
broad? My application works fine with those fields being private (which also makes the Gson
case easier because I can just tell it to cover all private fields, automatically ignoring
snapshotVersion, objectId, persistentState and other internal fields).


View raw message