HHH-14826 Fix failure of o.h.test.onetoone.cache.OneToOneCacheTest#OneToOneCacheByForeignKey()
This commit is contained in:
parent
340b9012d9
commit
5ffed50f1f
|
@ -215,11 +215,19 @@ public class OneToOneType extends EntityType {
|
|||
|
||||
@Override
|
||||
public Object assemble(Serializable oid, SharedSessionContractImplementor session, Object owner) throws HibernateException {
|
||||
|
||||
if ( oid == null ) {
|
||||
if ( uniqueKeyPropertyName != null ) {
|
||||
return resolve( session.getContextEntityIdentifier( owner ), session, owner );
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
//the owner of the association is not the owner of the id
|
||||
Serializable id = ( Serializable ) getIdentifierType( session ).assemble( oid, session, null );
|
||||
|
||||
if ( id == null ) {
|
||||
return resolve( session.getContextEntityIdentifier(owner), session, owner );
|
||||
return null;
|
||||
}
|
||||
|
||||
return resolveIdentifier( id, session );
|
||||
|
|
Loading…
Reference in New Issue