Just a heads up to those of you following this or who come across this.
This will be changing in 5.0 to get the mapping metadata from the entity when an IdClass is used. In fact it is already working that way on master.