use of org.neo4j.android.common.ParcelableRelationship in project neo4j-mobile-android by neo4j-contrib.
the class DbWrapper method updateRelationship.
@Override
public void updateRelationship(ParcelableRelationship rel, ParcelableError err) throws RemoteException {
try {
checkCallerHasWritePermission();
resumeTrx();
try {
Relationship target = mDb.getRelationshipById(rel.getId());
// remove existing properties
for (String key : target.getPropertyKeys()) {
target.removeProperty(key);
}
// set new properties
for (String key : rel.getPropertyKeys()) {
target.setProperty(key, rel.getProperty(key));
}
} finally {
suspendCurrentTrx("updateRelationship");
}
} catch (Exception e) {
Log.e(TAG, "Error updating relationship", e);
err.setError(Errors.TRANSACTION, e.getMessage());
}
}
use of org.neo4j.android.common.ParcelableRelationship in project neo4j-mobile-android by neo4j-contrib.
the class ParcelableFactory method makeParcelableRelationship.
public static ParcelableRelationship makeParcelableRelationship(Relationship rel) {
ParcelableRelationship pRel = new ParcelableRelationship();
pRel.setId(rel.getId());
pRel.setName(rel.getType().name());
pRel.setStartNodeId(rel.getStartNode().getId());
pRel.setEndNodeId(rel.getEndNode().getId());
// shallow copy of properties
for (String key : rel.getPropertyKeys()) {
pRel.setProperty(key, rel.getProperty(key));
}
return pRel;
}
Aggregations