On Fri, Nov 15, 2019 at 6:03 AM Clément Poulain <[email protected]> wrote:
>
> Hi,
>
> I'm trying to use @JsonManagedReference and @JsonBackReference with an 
> intermediate object in bewteen.
>
> Let's say I have those 3 objects:
>
>     class Parent {
>
>         Bucket childrenBucket;
>
>     }
>
>     class Bucket {
>
>         @JsonManagedReference
>         List<Child> children;
>
>     }
>
>     class Child {
>
>         @JsonBackReference
>         Parent parent;
>
>     }
>
> This is failing because of: 
> "com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot handle 
> managed/back reference 'defaultReference': back reference type (Parent) not 
> compatible with managed type (Bucket)"
>
> Is there a way to achieve this?

No, managed/back reference pair must be compatible. No other set ups
are supported.

-+ Tatu +-

-- 
You received this message because you are subscribed to the Google Groups 
"jackson-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jackson-user/CAL4a10izL7GESwqx8v5e7FYvwWGEiO60Hswau%2BiBJjVAwZG0mA%40mail.gmail.com.

Reply via email to