Add code generation to ChainedId.