From: NHibernate J. <mik...@us...> - 2007-01-24 09:43:28
|
[ http://jira.nhibernate.org/browse/NH-714?page=comments#action_14860 ] Sebastian Pienio commented on NH-714: ------------------------------------- Will this feature be available in final 1.2 version? There is nothing in trunk. Submitted patch is not working. After quick investigation it's obvious why: This is not enough ;) It looks like these methods needs to be changed to make this work: in Cfg\Configuration.cs public PersistentClass GetClassMapping( System.Type persistentClass ) in Impl\SessionFactoryImpl.cs public IEntityPersister GetEntityPersister(string className, bool throwIfNotFound) public IEntityPersister GetEntityPersister(System.Type theClass) I'm not sure about these two, because I'm not engaged in NHibernate project (yet;)): public NHibernate.Mapping.Collection GetCollectionMapping( string role ) public ICollectionPersister GetCollectionPersister(string role) GetClassMapping(System.Type) and GetEntityPersister(System.Type) is obvious. GetEntityPersister(String,Bool) is using "imports" dictionary which is pre-created. That's why it will not work for example with HQL (parser is calling GetClassMapping(String) to determine if token is a class name. Another issue is modify: in Impl\SessionFactoryImpl.cs string GetImportedClassName(string className) System.Type[] GetImplementorClasses(System.Type clazz) Second should add to results value "clazz" if in one of base classes of "clazz" is mapped (currently only "clazz" is checked). Anyway this change doesn't seem to be easy, yet IMHO enabling this feature can be quite handy when you're using object mapper software (automated class generation does not overwrite your changes). > Persistor Inheritance for Dynamic Proxies > ----------------------------------------- > > Key: NH-714 > URL: http://jira.nhibernate.org/browse/NH-714 > Project: NHibernate > Type: New Feature > Components: Core > Versions: 1.2.0.Beta2, 1.0.2 > Reporter: Curtis Schlak > Priority: Minor > Fix For: LATER > Attachments: version-1.x.patches.zip > > I have the opportunity to work with NHibernate in a project at work. We use dynamically-generated proxy objects for use in our application which renders the static NHibernate mapping files useless. We have found that a new feature allowing the framework to search the inheritance hierarchy for persisters used by the proxy's base class allows the transparent use of the dynamically-generated proxy objects. Please find in the attached ZIP archive file two patches that we have used to implement this feature, one patch for the 1.0 release branch and one for the upcoming 1.2 release branch in your development trunk. > USAGE > To activate this feature, add the property "hibernate.inherit_persisters" with a value of "true" to the configuration. > CHANGES > In Version 1.0 Release Branch > * In NHibernate.Test-1.1 project: > - Added the virtual "ExtraProperties" property to the TestCase class. > - Added the virtual "ExtraProperties" property to the TestCase class. > - Added the "Subclass\InheritPersisterFixture.cs" class to test the functionality. > * In NHibernate-1.1 project: > - Changed the "GetPersister(Type)" method in the SessionFactoryImpl class to search for inherited persisters. > In Trunk, along with the changes above, > * In NHibernate.Test-1.1 project: > - Cleaned up the NHibernate.Tests-1.1.csproj to compile. > - Removed the App.config file due to incompatibility with the .NET 1.1 framwork. > - Added the App-1.1.config file for .NET 1.1 Framework compatibility. > - Changed the projects PreBuildEvent to copy the App-1.1.config file. > * In NHibernate-1.1 project: > - Cleaned up the NHibernate-1.1.csproj file to compile. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.nhibernate.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: NHibernate J. <mik...@us...> - 2007-01-24 09:57:25
|
[ http://jira.nhibernate.org/browse/NH-714?page=comments#action_14861 ] Sergey Koshcheyev commented on NH-714: -------------------------------------- No, this will not be available in 1.2. > Persistor Inheritance for Dynamic Proxies > ----------------------------------------- > > Key: NH-714 > URL: http://jira.nhibernate.org/browse/NH-714 > Project: NHibernate > Type: New Feature > Components: Core > Versions: 1.2.0.Beta2, 1.0.2 > Reporter: Curtis Schlak > Priority: Minor > Fix For: LATER > Attachments: version-1.x.patches.zip > > I have the opportunity to work with NHibernate in a project at work. We use dynamically-generated proxy objects for use in our application which renders the static NHibernate mapping files useless. We have found that a new feature allowing the framework to search the inheritance hierarchy for persisters used by the proxy's base class allows the transparent use of the dynamically-generated proxy objects. Please find in the attached ZIP archive file two patches that we have used to implement this feature, one patch for the 1.0 release branch and one for the upcoming 1.2 release branch in your development trunk. > USAGE > To activate this feature, add the property "hibernate.inherit_persisters" with a value of "true" to the configuration. > CHANGES > In Version 1.0 Release Branch > * In NHibernate.Test-1.1 project: > - Added the virtual "ExtraProperties" property to the TestCase class. > - Added the virtual "ExtraProperties" property to the TestCase class. > - Added the "Subclass\InheritPersisterFixture.cs" class to test the functionality. > * In NHibernate-1.1 project: > - Changed the "GetPersister(Type)" method in the SessionFactoryImpl class to search for inherited persisters. > In Trunk, along with the changes above, > * In NHibernate.Test-1.1 project: > - Cleaned up the NHibernate.Tests-1.1.csproj to compile. > - Removed the App.config file due to incompatibility with the .NET 1.1 framwork. > - Added the App-1.1.config file for .NET 1.1 Framework compatibility. > - Changed the projects PreBuildEvent to copy the App-1.1.config file. > * In NHibernate-1.1 project: > - Cleaned up the NHibernate-1.1.csproj file to compile. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.nhibernate.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |