Your example seems to only fail when the following configuration options are set
<property name="hibernate.order_updates" value="true"/> <property name="hibernate.order_inserts" value="true"/>