`

hibernate多对多,更新时外键为null问题

阅读更多
		<!-- 配置一对多的关系  -->
		<set name="providerProducts" inverse="true">
			<key column="product_id" />
			<one-to-many class="ProviderProduct" />
		</set>
		<set name="tickerProducts" inverse="true">
			<key column="product_id" />
			<one-to-many class="TickerProduct" />
		</set>

 注意不要设置级联,然后表明inverse为true

 

good lucky!!!

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics