Modifying related nodes before saving them

Consider a class like this:

class A {
	List<B> bs;

When saving an A, how can I perform some modifications to the "B"s before saving them? (Something like @Convert but for @Relationship not a simple attribute). One application may be to set an order attribute in the nodes corresponding to "B"s (See here).