Is the backbone stack aware of object references in JSON?

73 views
Skip to first unread message

manos

unread,
Dec 4, 2012, 4:05:46 PM12/4/12
to resth...@googlegroups.com
Hello,

Congrats for the 2.0.0 release! Already in my POMs. To my question: My root entity uses UUIDs as PKs and uses @JsonIdentityInfo to serialize each object only once and using references for other instances of the same object in the same JSON response. However the backbone stack does not seem able to cope with the references. Am I missing something? Is this not supported?

@MappedSuperclass
@JsonIdentityInfo(generator = ObjectIdGenerators.PropertyGenerator.class, property = "id")
public abstract class AbstractPersistable implements Persistable<String> {
   
    @Id
    @GeneratedValue(generator = "system-uuid")
    @GenericGenerator(name = "system-uuid", strategy = "uuid2")
    @Column(name = "id", unique = true)
    private String id;

    // rest of code ommited
}



Many thanks,

Manos

Brian

unread,
Dec 5, 2012, 11:29:51 AM12/5/12
to resth...@googlegroups.com
Hello there.

Short answer: no, this is not currently supported in the backbone stack.

For the short term, you could consider integrating libs like dojox.json.ref within your client stack. But those libs rely on the json-ref syntax, which is not supported by jackson. To me, it seems like Jackson added this feature for server to server communication, since object references aren't clearly showed in the serialized object. You can see the discussion on their JIRA issue.

Anyway, we're looking into this - you can follow/comment on this issue on github.

-- Brian



--
 
 
 

Reply all
Reply to author
Forward
0 new messages