The add-person rpc needs to pass true for ensureParents when adding
a person into the datastore. This ensures that it can be called on
an empty model.
Similarly when the CarBought notification is received and we try to
add a car-person to the datastore we need to do it with ensureParents
so that the data can be added to an empty model.
Change-Id: I551038298d635ff6daed0f5dae49a6eda86a24cb
Signed-off-by: Moiz Raja <moraja@cisco.com>
WriteTransaction tx = dataProvider.newWriteOnlyTransaction();
WriteTransaction tx = dataProvider.newWriteOnlyTransaction();
- tx.put(LogicalDatastoreType.CONFIGURATION, carPersonIId, carPerson);
+ tx.put(LogicalDatastoreType.CONFIGURATION, carPersonIId, carPerson, true);
Futures.addCallback(tx.submit(), new FutureCallback<Void>() {
@Override
Futures.addCallback(tx.submit(), new FutureCallback<Void>() {
@Override
final InstanceIdentifier personId = personIdBuilder.build();
// Place entry in data store tree
WriteTransaction tx = dataProvider.newWriteOnlyTransaction();
final InstanceIdentifier personId = personIdBuilder.build();
// Place entry in data store tree
WriteTransaction tx = dataProvider.newWriteOnlyTransaction();
- tx.put(LogicalDatastoreType.CONFIGURATION, personId, person);
+ tx.put(LogicalDatastoreType.CONFIGURATION, personId, person, true);
Futures.addCallback(tx.submit(), new FutureCallback<Void>() {
@Override
Futures.addCallback(tx.submit(), new FutureCallback<Void>() {
@Override