mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-28 06:49:09 +00:00
HHH-4725 implement orphanRemoval for OneToOne.
git-svn-id: https://svn.jboss.org/repos/hibernate/core/trunk@18581 1b8cb986-b30d-0410-93ca-fae66ebed9b2
This commit is contained in:
parent
e474a00c4a
commit
63d5a97854
@ -1455,7 +1455,7 @@ else if ( property.isAnnotationPresent( OneToOne.class ) ) {
|
||||
}
|
||||
}
|
||||
bindOneToOne(
|
||||
getCascadeStrategy( ann.cascade(), hibernateCascade, false),
|
||||
getCascadeStrategy( ann.cascade(), hibernateCascade, ann.orphanRemoval()),
|
||||
joinColumns,
|
||||
ann.optional(),
|
||||
getFetchMode( ann.fetch() ),
|
||||
@ -2147,6 +2147,10 @@ private static void bindManyToOne(
|
||||
) {
|
||||
//All FK columns should be in the same table
|
||||
org.hibernate.mapping.ManyToOne value = new org.hibernate.mapping.ManyToOne( columns[0].getTable() );
|
||||
// This is a @OneToOne mapped to a physical o.h.mapping.ManyToOne
|
||||
if ( unique ) {
|
||||
value.markAsLogicalOneToOne();
|
||||
}
|
||||
if ( isDefault( targetEntity, mappings ) ) {
|
||||
value.setReferencedEntityName( inferredData.getClassOrElementName() );
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user