From: <leg...@at...> - 2003-12-11 06:33:16
|
The following comment has been added to this issue: Author: Gavin King Created: Thu, 11 Dec 2003 12:32 AM Body: 1) should already be possible, right? 2) is certainly already possible: Interceptor.instantiate() --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-382 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-382 Summary: Make Hibernate Friendlier for use of Proxies and Enhanced Classes Type: New Feature Status: Unassigned Priority: Major Project: Hibernate2 Versions: 2.1 final Assignee: Reporter: James House Created: Mon, 6 Oct 2003 4:29 PM Updated: Thu, 11 Dec 2003 12:32 AM Description: Hibernate could become friendly to applications that make use of proxies and byte-code enchanced classes in their object models. To do so, only a couple simple new features are needed: 1) Add a construct (new method) to Configuration that lets you relate one class's mappings to another (i.e. tell Hibernate that: if you ever have to persist this class, act as if it is this other class that you already have mappings for). - This will serve to tell Hibernate that the enhanced class (who's class name is only known at run-time) should be persisted using the mappings of the original class. Note that in this case, the enhanced class only has changed behavior - no new properties. 2) Add a construct to relate a "factory" to a class's mappings, from which Hibernate should produce new instances of that class during load() operations. - This will server to tell Hibernate that it should create a new instance of a class (during load()) using the given factory, rather than using the default constructor. This way Hibernate can produce enhanced or proxied or even just sub-classes of objects without being aware of it. This feature would also be useful to other people, who simply need the object to be created a special way. I'd be happy to donate this work if it would be accepted - just let me know (either as a comment to this issue, or via e-mail) that it will be worth my time to do the work. james --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: <leg...@at...> - 2004-01-18 23:17:49
|
The following comment has been added to this issue: Author: James House Created: Sun, 18 Jan 2004 5:17 PM Body: I understand how #2 is possible with the use of an interceptor. How exactly is #1 possible? Forgive me if I'm missing something that should be obvious. I've gone through the docs a few times, and the API a few times as well searching for a way... I've read how polymorphism works, but I'm looking for functionality that does not require a discriminator, nor a mapping file that names the implementation class directly - since the impl. class will be generated on the fly, and its name won't be known until that moment. I've experimented with this, and always end up with errors along the lines of no mappings for given class, or class-cast exceptions and so forth. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-382 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-382 Summary: Make Hibernate Friendlier for use of Proxies and Enhanced Classes Type: New Feature Status: Unassigned Priority: Major Original Estimate: Unknown Time Spent: Unknown Remaining: Unknown Project: Hibernate2 Components: core Versions: 2.1 final Assignee: Reporter: James House Created: Mon, 6 Oct 2003 4:29 PM Updated: Sun, 18 Jan 2004 5:17 PM Description: Hibernate could become friendly to applications that make use of proxies and byte-code enchanced classes in their object models. To do so, only a couple simple new features are needed: 1) Add a construct (new method) to Configuration that lets you relate one class's mappings to another (i.e. tell Hibernate that: if you ever have to persist this class, act as if it is this other class that you already have mappings for). - This will serve to tell Hibernate that the enhanced class (who's class name is only known at run-time) should be persisted using the mappings of the original class. Note that in this case, the enhanced class only has changed behavior - no new properties. 2) Add a construct to relate a "factory" to a class's mappings, from which Hibernate should produce new instances of that class during load() operations. - This will server to tell Hibernate that it should create a new instance of a class (during load()) using the given factory, rather than using the default constructor. This way Hibernate can produce enhanced or proxied or even just sub-classes of objects without being aware of it. This feature would also be useful to other people, who simply need the object to be created a special way. I'd be happy to donate this work if it would be accepted - just let me know (either as a comment to this issue, or via e-mail) that it will be worth my time to do the work. james --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: <leg...@at...> - 2004-01-18 23:26:49
|
The following comment has been added to this issue: Author: James House Created: Sun, 18 Jan 2004 5:26 PM Body: ... sorry, I meant to also add that even for #2 (the production of class instances) - it would be nice to have a formal mechanism (on the api) for tying this all together. Such as I suggested above - a way to tell Hibernate something like: "When you see class Y, think of it as class X. And when you need to make a class X, make a class Y instead, with this factory that I'm handing you." james --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-382 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-382 Summary: Make Hibernate Friendlier for use of Proxies and Enhanced Classes Type: New Feature Status: Unassigned Priority: Major Original Estimate: Unknown Time Spent: Unknown Remaining: Unknown Project: Hibernate2 Components: core Versions: 2.1 final Assignee: Reporter: James House Created: Mon, 6 Oct 2003 4:29 PM Updated: Sun, 18 Jan 2004 5:26 PM Description: Hibernate could become friendly to applications that make use of proxies and byte-code enchanced classes in their object models. To do so, only a couple simple new features are needed: 1) Add a construct (new method) to Configuration that lets you relate one class's mappings to another (i.e. tell Hibernate that: if you ever have to persist this class, act as if it is this other class that you already have mappings for). - This will serve to tell Hibernate that the enhanced class (who's class name is only known at run-time) should be persisted using the mappings of the original class. Note that in this case, the enhanced class only has changed behavior - no new properties. 2) Add a construct to relate a "factory" to a class's mappings, from which Hibernate should produce new instances of that class during load() operations. - This will server to tell Hibernate that it should create a new instance of a class (during load()) using the given factory, rather than using the default constructor. This way Hibernate can produce enhanced or proxied or even just sub-classes of objects without being aware of it. This feature would also be useful to other people, who simply need the object to be created a special way. I'd be happy to donate this work if it would be accepted - just let me know (either as a comment to this issue, or via e-mail) that it will be worth my time to do the work. james --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |