[HHH-8354]
changed the setComposite to after the variable is set
use EntityMetaModel.getPropertyIndexOrNull to get the correct index