Hello,
I originally reverse engineered an Oracle DB. My numeric fields being of type NUMBER, the datamap contained NUMERIC DB type and then BigDecimal Obj type. Especially for ID PKs.
Now, when trying to save an object, I got an exception saying that cayenne was not able to cast the generated PK (Integer) to the object field type (BigDecimal). I converted then all the ID PKs to Integer and adapted the relationships.
The thing is now, that AgRest does not seem to output related objects in the JSON output.
Related objects appear as null and many to many as empty arrays.
But the converted PK of the root object displays properly.
It all work again when switching back to BigDecimal.
I tried with BigInteger, it does not work. I tried Integer and also DB type INTEGER instead of NUMERIC, still nothing. It would only work with BigDecimal.
I checked the fetched cayenne entity, it contains the related entities. Even the returned DataResponse contains them. It seems to happen after, when serializing to JSON.
The only logs I can get from AgRest are those lines for the root entity and related entities:
DEBUG io.agrest.cayenne.compiler.CayenneAgEntityCompiler - compiling Cayenne entity for type: <...>
Any thoughts on this? Could there be some remnants of the BigDecimal somewhere? I checked the datamap, all clear. But I might have missed something.
Thank you.
Anthonin