If a entity uses @MapsId on another entity you can not persist both of these entities in the same transaction.