There is a documentation error on this page: https://docs.corda.net/api-persistence.html#persisting-hierarchical-data.
The above code results in the table join failing and the child table will contain two versions of both "output_index" and "transaction_id" one of which will always have empty data. A better solution would be the following:
It may be worth noting that the name field in @JoinColumn needs to start with the name of the linking attribute in the child.
is this still a bug?
This is a very old bug, please fix as soon as you can and propagate as needed.