Hi, I found js-data has a inconsistent behavior about populating the localKey/foreignKey on injecting.
When injecting an entity together with its belongsTo entity, the localKey is not set correctly. This behavior is inconsistent with that of hasMany relationships.
Refer to this test code for detail.
http://codepen.io/wewei/pen/yYvvVP?editors=001
Not sure if it's on purpose or not. Even it's by design, it behavior still looks buggy. It feels more natural to always populate the localKey/foreignKey on cascading creation.