-
Notifications
You must be signed in to change notification settings - Fork 934
Improved collection batch fetching #1558
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
0cd9c10
4b40405
518797c
ff01ff7
066cd0a
8e337ea
488618b
827cb44
c0e0d55
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -298,12 +298,32 @@ public void PreFlush(IPersistentCollection collection) | |
/// has been initialized. | ||
/// </summary> | ||
/// <param name="collection">The initialized <see cref="AbstractPersistentCollection"/> that this Entry is for.</param> | ||
//Since v5.1 | ||
[Obsolete("Please use PostInitialize(collection, persistenceContext) instead.")] | ||
public void PostInitialize(IPersistentCollection collection) | ||
{ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The single argument There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
snapshot = LoadedPersister.IsMutable ? collection.GetSnapshot(LoadedPersister) : null; | ||
collection.SetSnapshot(loadedKey, role, snapshot); | ||
} | ||
|
||
/// <summary> | ||
/// Updates the CollectionEntry to reflect that the <see cref="IPersistentCollection"/> | ||
/// has been initialized. | ||
/// </summary> | ||
/// <param name="collection">The initialized <see cref="AbstractPersistentCollection"/> that this Entry is for.</param> | ||
/// <param name="persistenceContext"></param> | ||
public void PostInitialize(IPersistentCollection collection, IPersistenceContext persistenceContext) | ||
{ | ||
#pragma warning disable 618 | ||
//6.0 TODO: Inline PostInitialize here. | ||
PostInitialize(collection); | ||
#pragma warning restore 618 | ||
if (LoadedPersister.GetBatchSize() > 1) | ||
{ | ||
persistenceContext.BatchFetchQueue.RemoveBatchLoadableCollection(this); | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// Updates the CollectionEntry to reflect that it is has been successfully flushed to the database. | ||
/// </summary> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -835,6 +835,10 @@ public void AddUninitializedCollection(ICollectionPersister persister, IPersiste | |
{ | ||
CollectionEntry ce = new CollectionEntry(collection, persister, id, flushing); | ||
AddCollection(collection, ce, id); | ||
if (persister.GetBatchSize() > 1) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here but for |
||
{ | ||
batchFetchQueue.AddBatchLoadableCollection(collection, ce); | ||
} | ||
} | ||
|
||
/// <summary> add a detached uninitialized collection</summary> | ||
|
@@ -913,7 +917,7 @@ public CollectionEntry AddInitializedCollection(ICollectionPersister persister, | |
object id) | ||
{ | ||
CollectionEntry ce = new CollectionEntry(collection, persister, id, flushing); | ||
ce.PostInitialize(collection); | ||
ce.PostInitialize(collection, this); | ||
AddCollection(collection, ce, id); | ||
return ce; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comments now looks redundant.