hibernate一对一,共享主键,配置从表的时候,需要让从表的主键生成策略设置为:
@GeneratedValue(generator="foreign")
@GenericGenerator(name="foreign", strategy = "foreign", parameters={
@Parameter(name="property", value="one2onePramary")
})
@GeneratedValue(generator="foreign")
@GenericGenerator(name="foreign", strategy = "foreign", parameters={
@Parameter(name="property", value="one2onePramary")
})