Skip to content

Commit

Permalink
Not using proxies for ToOne relations anymore.
Browse files Browse the repository at this point in the history
Instead override sessionImpl.LoadImmediate behavior.
  • Loading branch information
RogerKratz committed Dec 4, 2018
1 parent 7191667 commit b555d44
Show file tree
Hide file tree
Showing 10 changed files with 559 additions and 91 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@ private void addOneToManyAttached(bool fakeOneToManyBidirectional)
MappingTools.CreateToOneRelationPrefix(auditMappedBy));

fakeBidirectionalRelationMapper = new ToOneIdMapper(
_mainGenerator.GlobalCfg.EnversProxyFactory,
relMapper,
// The mapper will only be used to map from entity to map, so no need to provide other details
// when constructing the PropertyData.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public void AddToOne(XElement parent, PropertyAuditingData propertyAuditingData,

// Adding mapper for the id
var propertyData = propertyAuditingData.GetPropertyData();
mapper.AddComposite(propertyData, new ToOneIdMapper(_mainGenerator.GlobalCfg.EnversProxyFactory, relMapper, propertyData, referencedEntityName, nonInsertableFake));
mapper.AddComposite(propertyData, new ToOneIdMapper(relMapper, propertyData, referencedEntityName, nonInsertableFake));
}

private static XElement firstJoinElement(XElement classElement)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,5 @@ public interface IEnversProxyFactory
/// Creates a collection proxy.
/// </summary>
object CreateCollectionProxy(System.Type collectionInterface, IInitializor collectionInitializor);

/// <summary>
/// Creates a proxy for a x-to-one releationship.
/// </summary>
object CreateToOneProxy(AuditConfiguration verCfg, IAuditReaderImplementor versionsReader, string referencedEntityName, object entityId, long revision, bool removed);
}
}
Loading

0 comments on commit b555d44

Please sign in to comment.