-
Notifications
You must be signed in to change notification settings - Fork 934
Partially port Hibernate's current field interceptor mechanism #1947
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
Merged
fredericDelaporte
merged 8 commits into
nhibernate:master
from
maca88:PocoEntityInstantiator
Jan 11, 2019
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
add4a82
Partially port Hibernate's current field interceptor mechanism
maca88 572c254
Add missing pragma warning for FieldInterceptorProxyBuilder
maca88 dd9204b
Revert "Add missing pragma warning for FieldInterceptorProxyBuilder"
maca88 c3e6c70
Address issues from comments
maca88 c7179a8
Swap conditions for skipping proxy checking once the session is set
maca88 3de13db
Fix interceptor to not set a property as initialized when an initiali…
maca88 5d7d706
Fix broken tests
maca88 6ee80f9
Ensure original proxy factory is restored
fredericDelaporte File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
40 changes: 40 additions & 0 deletions
40
src/NHibernate.Test/Async/GhostProperty/GhostPropertyDynamicProxyFixture.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
//------------------------------------------------------------------------------ | ||
// <auto-generated> | ||
// This code was generated by AsyncGenerator. | ||
// | ||
// Changes to this file may cause incorrect behavior and will be lost if | ||
// the code is regenerated. | ||
// </auto-generated> | ||
//------------------------------------------------------------------------------ | ||
|
||
|
||
using System; | ||
using NHibernate.Bytecode; | ||
using NUnit.Framework; | ||
|
||
namespace NHibernate.Test.GhostProperty | ||
{ | ||
using System.Threading.Tasks; | ||
// Since 5.3 | ||
[Obsolete] | ||
[TestFixture] | ||
public class GhostPropertyDynamicProxyFixtureAsync : GhostPropertyFixtureAsync | ||
{ | ||
private string _originalProxyFactoryFactory; | ||
|
||
protected override void Configure(Cfg.Configuration configuration) | ||
{ | ||
base.Configure(configuration); | ||
_originalProxyFactoryFactory = Cfg.Environment.BytecodeProvider.ProxyFactoryFactory.GetType().FullName; | ||
configuration.SetProperty(Cfg.Environment.ProxyFactoryFactoryClass, typeof(DefaultProxyFactoryFactory).FullName); | ||
} | ||
|
||
protected override void DropSchema() | ||
{ | ||
base.DropSchema(); | ||
// Reset IProxyFactoryFactory back to default | ||
var injectableProxyFactory = (IInjectableProxyFactoryFactory) Cfg.Environment.BytecodeProvider; | ||
injectableProxyFactory.SetProxyFactoryFactory(_originalProxyFactoryFactory); | ||
} | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
src/NHibernate.Test/GhostProperty/GhostPropertyDynamicProxyFixture.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using System; | ||
using NHibernate.Bytecode; | ||
using NUnit.Framework; | ||
|
||
namespace NHibernate.Test.GhostProperty | ||
{ | ||
// Since 5.3 | ||
[Obsolete] | ||
[TestFixture] | ||
public class GhostPropertyDynamicProxyFixture : GhostPropertyFixture | ||
{ | ||
private string _originalProxyFactoryFactory; | ||
|
||
protected override void Configure(Cfg.Configuration configuration) | ||
{ | ||
base.Configure(configuration); | ||
_originalProxyFactoryFactory = Cfg.Environment.BytecodeProvider.ProxyFactoryFactory.GetType().FullName; | ||
configuration.SetProperty(Cfg.Environment.ProxyFactoryFactoryClass, typeof(DefaultProxyFactoryFactory).FullName); | ||
} | ||
|
||
protected override void DropSchema() | ||
{ | ||
base.DropSchema(); | ||
// Reset IProxyFactoryFactory back to default | ||
var injectableProxyFactory = (IInjectableProxyFactoryFactory) Cfg.Environment.BytecodeProvider; | ||
injectableProxyFactory.SetProxyFactoryFactory(_originalProxyFactoryFactory); | ||
} | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.