From: Gavin K. <gav...@jb...> - 2006-05-28 20:02:16
|
As you guys know, I've been against the idea of fetch profiles for a long time (Max always disagreed). (BTW, please clearly distingush "fetch profiles" from "fetch plans". We have had "fetch plans" for years, as a subset of what the Criteria API can do.) The basis for my problem was that a fetch profile is really specific to a particular transaction, but ends up being expressed in the mapping document, which is a _global_ construct. So, if I try to use this "fetch profile" approach, what happens is that I end up with a list of transactions in every association mapping. Clearly this does not scale to systems with hundreds of transactions that touch the same data (which is commonplace). So instead, we tried to guide people down the "express what data you need, upfront, in your query" path, which not only avoids this code scalability problem, but is also by nature more efficient. What you might also know (but maybe you don't) is that Hibernate has internally supported fetch profiles for quite a long time (we actually have a special fetch profile that is used internally for the merge() operation). We never actually exposed this to users, since in practice users never seemed to ask for it, and because we in principle do things that users actually want and ask for, not things that our competitors marketing departments tell people they want. It occurred to me today that you could avoid my objection just by defining the fetch profile in its own section of the XML, instead of in the association mappings. eg. <profile name=3D"login"> <association name=3D"User.roles" fetch=3D"join"/> <association name=3D"User.orders" fetch=3D"select"/> </profile> Then just call session.setProfile("login"), and all criteria queries, load(), get() and association fetches would obey the profile. Frankly, I feel silly for not have considered to do it that way before. The <profile> could also be a good place to make some other things settable, eg, TX isolation mode, flushmode, TX timeout, etc. WDYT? Is it a nice construct? |
From: SourceForge.net <no...@so...> - 2003-02-18 11:36:59
|
Patches item #688610, was opened at 2003-02-18 11:45 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=428710&aid=688610&group_id=40712 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Konstantin Dmitriev (kdmitriev) Assigned to: Nobody/Anonymous (nobody) Summary: Fetch profiles Initial Comment: Here's my code for fetch profiles. No test case is currently developed (though I have my own). I hope you can test on your own model ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=428710&aid=688610&group_id=40712 |
From: SourceForge.net <no...@so...> - 2003-02-18 12:20:37
|
Patches item #688610, was opened at 2003-02-18 11:45 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=428710&aid=688610&group_id=40712 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Konstantin Dmitriev (kdmitriev) Assigned to: Nobody/Anonymous (nobody) Summary: Fetch profiles Initial Comment: Here's my code for fetch profiles. No test case is currently developed (though I have my own). I hope you can test on your own model ---------------------------------------------------------------------- >Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-02-18 12:28 Message: Logged In: YES user_id=693406 Where is the archive? Strange! Attaching again ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=428710&aid=688610&group_id=40712 |
From: SourceForge.net <no...@so...> - 2003-02-18 12:30:21
|
Patches item #688610, was opened at 2003-02-18 11:45 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=428710&aid=688610&group_id=40712 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Konstantin Dmitriev (kdmitriev) Assigned to: Nobody/Anonymous (nobody) Summary: Fetch profiles Initial Comment: Here's my code for fetch profiles. No test case is currently developed (though I have my own). I hope you can test on your own model ---------------------------------------------------------------------- >Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-02-18 12:38 Message: Logged In: YES user_id=693406 Now with the test case. It's for Oracle (Is it a problem?) ---------------------------------------------------------------------- Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-02-18 12:28 Message: Logged In: YES user_id=693406 Where is the archive? Strange! Attaching again ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=428710&aid=688610&group_id=40712 |
From: SourceForge.net <no...@so...> - 2003-02-19 13:45:03
|
Patches item #688610, was opened at 2003-02-18 11:45 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=428710&aid=688610&group_id=40712 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Konstantin Dmitriev (kdmitriev) Assigned to: Nobody/Anonymous (nobody) Summary: Fetch profiles Initial Comment: Here's my code for fetch profiles. No test case is currently developed (though I have my own). I hope you can test on your own model ---------------------------------------------------------------------- >Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-02-19 13:53 Message: Logged In: YES user_id=693406 - added support for Maps - added support for Collections of values - various mappings added to the test model: list, map, bag, collection of values, one-to-one, many-to-many, component one-to-one present a problem, because lazy load is not supported ---------------------------------------------------------------------- Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-02-18 12:38 Message: Logged In: YES user_id=693406 Now with the test case. It's for Oracle (Is it a problem?) ---------------------------------------------------------------------- Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-02-18 12:28 Message: Logged In: YES user_id=693406 Where is the archive? Strange! Attaching again ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=428710&aid=688610&group_id=40712 |
From: SourceForge.net <no...@so...> - 2003-02-19 21:32:49
|
Patches item #688610, was opened at 2003-02-18 03:45 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=428710&aid=688610&group_id=40712 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Konstantin Dmitriev (kdmitriev) Assigned to: Nobody/Anonymous (nobody) Summary: Fetch profiles Initial Comment: Here's my code for fetch profiles. No test case is currently developed (though I have my own). I hope you can test on your own model ---------------------------------------------------------------------- Comment By: Chris Nokleberg (herbyderby) Date: 2003-02-19 13:41 Message: Logged In: YES user_id=594737 Instead of parsing queries to determine what fields need to be fetched, I suggest that fetch profiles only be allowed for lazy-loading proxies. Accesses to the underlying getters could be intercepted, mapped to a profile, and loaded if necessary. Basically breaking up a lazy entity into distinct subsets of properties, each of which get loaded independently just-in-time. ---------------------------------------------------------------------- Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-02-19 05:53 Message: Logged In: YES user_id=693406 - added support for Maps - added support for Collections of values - various mappings added to the test model: list, map, bag, collection of values, one-to-one, many-to-many, component one-to-one present a problem, because lazy load is not supported ---------------------------------------------------------------------- Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-02-18 04:38 Message: Logged In: YES user_id=693406 Now with the test case. It's for Oracle (Is it a problem?) ---------------------------------------------------------------------- Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-02-18 04:28 Message: Logged In: YES user_id=693406 Where is the archive? Strange! Attaching again ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=428710&aid=688610&group_id=40712 |
From: SourceForge.net <no...@so...> - 2003-02-20 05:40:27
|
Patches item #688610, was opened at 2003-02-18 11:45 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=428710&aid=688610&group_id=40712 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Konstantin Dmitriev (kdmitriev) Assigned to: Nobody/Anonymous (nobody) Summary: Fetch profiles Initial Comment: Here's my code for fetch profiles. No test case is currently developed (though I have my own). I hope you can test on your own model ---------------------------------------------------------------------- >Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-02-20 05:49 Message: Logged In: YES user_id=693406 Hello Chris 1. According to Max R. Andersen's request, fetch profiles are defined in a way similar to sessions.setClassFectchProfiles (class1, "property1, property2"); i.e. not in the query 2. The whole thing is not about transparent eager loading lazy-loading proxies. It's about avoiding N+1. Quite different. I suggest you have a look at the patch and test cases Thank you very much for your feedback Best regards, Konstantin Dmitriev ---------------------------------------------------------------------- Comment By: Chris Nokleberg (herbyderby) Date: 2003-02-19 21:41 Message: Logged In: YES user_id=594737 Instead of parsing queries to determine what fields need to be fetched, I suggest that fetch profiles only be allowed for lazy-loading proxies. Accesses to the underlying getters could be intercepted, mapped to a profile, and loaded if necessary. Basically breaking up a lazy entity into distinct subsets of properties, each of which get loaded independently just-in-time. ---------------------------------------------------------------------- Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-02-19 13:53 Message: Logged In: YES user_id=693406 - added support for Maps - added support for Collections of values - various mappings added to the test model: list, map, bag, collection of values, one-to-one, many-to-many, component one-to-one present a problem, because lazy load is not supported ---------------------------------------------------------------------- Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-02-18 12:38 Message: Logged In: YES user_id=693406 Now with the test case. It's for Oracle (Is it a problem?) ---------------------------------------------------------------------- Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-02-18 12:28 Message: Logged In: YES user_id=693406 Where is the archive? Strange! Attaching again ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=428710&aid=688610&group_id=40712 |
From: SourceForge.net <no...@so...> - 2003-02-21 08:42:37
|
Patches item #688610, was opened at 2003-02-18 11:45 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=428710&aid=688610&group_id=40712 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Konstantin Dmitriev (kdmitriev) Assigned to: Nobody/Anonymous (nobody) Summary: Fetch profiles Initial Comment: Here's my code for fetch profiles. No test case is currently developed (though I have my own). I hope you can test on your own model ---------------------------------------------------------------------- >Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-02-21 08:51 Message: Logged In: YES user_id=693406 Sorry about one-to-one. works now ---------------------------------------------------------------------- Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-02-20 05:49 Message: Logged In: YES user_id=693406 Hello Chris 1. According to Max R. Andersen's request, fetch profiles are defined in a way similar to sessions.setClassFectchProfiles (class1, "property1, property2"); i.e. not in the query 2. The whole thing is not about transparent eager loading lazy-loading proxies. It's about avoiding N+1. Quite different. I suggest you have a look at the patch and test cases Thank you very much for your feedback Best regards, Konstantin Dmitriev ---------------------------------------------------------------------- Comment By: Chris Nokleberg (herbyderby) Date: 2003-02-19 21:41 Message: Logged In: YES user_id=594737 Instead of parsing queries to determine what fields need to be fetched, I suggest that fetch profiles only be allowed for lazy-loading proxies. Accesses to the underlying getters could be intercepted, mapped to a profile, and loaded if necessary. Basically breaking up a lazy entity into distinct subsets of properties, each of which get loaded independently just-in-time. ---------------------------------------------------------------------- Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-02-19 13:53 Message: Logged In: YES user_id=693406 - added support for Maps - added support for Collections of values - various mappings added to the test model: list, map, bag, collection of values, one-to-one, many-to-many, component one-to-one present a problem, because lazy load is not supported ---------------------------------------------------------------------- Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-02-18 12:38 Message: Logged In: YES user_id=693406 Now with the test case. It's for Oracle (Is it a problem?) ---------------------------------------------------------------------- Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-02-18 12:28 Message: Logged In: YES user_id=693406 Where is the archive? Strange! Attaching again ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=428710&aid=688610&group_id=40712 |
From: SourceForge.net <no...@so...> - 2003-02-27 14:09:16
|
Patches item #688610, was opened at 2003-02-18 21:45 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=428710&aid=688610&group_id=40712 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Konstantin Dmitriev (kdmitriev) Assigned to: Nobody/Anonymous (nobody) Summary: Fetch profiles Initial Comment: Here's my code for fetch profiles. No test case is currently developed (though I have my own). I hope you can test on your own model ---------------------------------------------------------------------- Comment By: Cameron Braid (cameronbraid) Date: 2003-02-28 00:18 Message: Logged In: YES user_id=196175 I would like to try this patch. Though to do so I will need to insert a heap of data.. Do you have a dataset that can be added to the patch ? I suggest that you use DBUnit's flat xml data set as they are quite easy to export / import. ---------------------------------------------------------------------- Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-02-21 18:51 Message: Logged In: YES user_id=693406 Sorry about one-to-one. works now ---------------------------------------------------------------------- Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-02-20 15:49 Message: Logged In: YES user_id=693406 Hello Chris 1. According to Max R. Andersen's request, fetch profiles are defined in a way similar to sessions.setClassFectchProfiles (class1, "property1, property2"); i.e. not in the query 2. The whole thing is not about transparent eager loading lazy-loading proxies. It's about avoiding N+1. Quite different. I suggest you have a look at the patch and test cases Thank you very much for your feedback Best regards, Konstantin Dmitriev ---------------------------------------------------------------------- Comment By: Chris Nokleberg (herbyderby) Date: 2003-02-20 07:41 Message: Logged In: YES user_id=594737 Instead of parsing queries to determine what fields need to be fetched, I suggest that fetch profiles only be allowed for lazy-loading proxies. Accesses to the underlying getters could be intercepted, mapped to a profile, and loaded if necessary. Basically breaking up a lazy entity into distinct subsets of properties, each of which get loaded independently just-in-time. ---------------------------------------------------------------------- Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-02-19 23:53 Message: Logged In: YES user_id=693406 - added support for Maps - added support for Collections of values - various mappings added to the test model: list, map, bag, collection of values, one-to-one, many-to-many, component one-to-one present a problem, because lazy load is not supported ---------------------------------------------------------------------- Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-02-18 22:38 Message: Logged In: YES user_id=693406 Now with the test case. It's for Oracle (Is it a problem?) ---------------------------------------------------------------------- Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-02-18 22:28 Message: Logged In: YES user_id=693406 Where is the archive? Strange! Attaching again ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=428710&aid=688610&group_id=40712 |
From: SourceForge.net <no...@so...> - 2003-02-28 08:29:51
|
Patches item #688610, was opened at 2003-02-18 11:45 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=428710&aid=688610&group_id=40712 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Konstantin Dmitriev (kdmitriev) Assigned to: Nobody/Anonymous (nobody) Summary: Fetch profiles Initial Comment: Here's my code for fetch profiles. No test case is currently developed (though I have my own). I hope you can test on your own model ---------------------------------------------------------------------- >Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-02-28 08:39 Message: Logged In: YES user_id=693406 SQL scripts to import test data ---------------------------------------------------------------------- Comment By: Cameron Braid (cameronbraid) Date: 2003-02-27 14:18 Message: Logged In: YES user_id=196175 I would like to try this patch. Though to do so I will need to insert a heap of data.. Do you have a dataset that can be added to the patch ? I suggest that you use DBUnit's flat xml data set as they are quite easy to export / import. ---------------------------------------------------------------------- Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-02-21 08:51 Message: Logged In: YES user_id=693406 Sorry about one-to-one. works now ---------------------------------------------------------------------- Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-02-20 05:49 Message: Logged In: YES user_id=693406 Hello Chris 1. According to Max R. Andersen's request, fetch profiles are defined in a way similar to sessions.setClassFectchProfiles (class1, "property1, property2"); i.e. not in the query 2. The whole thing is not about transparent eager loading lazy-loading proxies. It's about avoiding N+1. Quite different. I suggest you have a look at the patch and test cases Thank you very much for your feedback Best regards, Konstantin Dmitriev ---------------------------------------------------------------------- Comment By: Chris Nokleberg (herbyderby) Date: 2003-02-19 21:41 Message: Logged In: YES user_id=594737 Instead of parsing queries to determine what fields need to be fetched, I suggest that fetch profiles only be allowed for lazy-loading proxies. Accesses to the underlying getters could be intercepted, mapped to a profile, and loaded if necessary. Basically breaking up a lazy entity into distinct subsets of properties, each of which get loaded independently just-in-time. ---------------------------------------------------------------------- Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-02-19 13:53 Message: Logged In: YES user_id=693406 - added support for Maps - added support for Collections of values - various mappings added to the test model: list, map, bag, collection of values, one-to-one, many-to-many, component one-to-one present a problem, because lazy load is not supported ---------------------------------------------------------------------- Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-02-18 12:38 Message: Logged In: YES user_id=693406 Now with the test case. It's for Oracle (Is it a problem?) ---------------------------------------------------------------------- Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-02-18 12:28 Message: Logged In: YES user_id=693406 Where is the archive? Strange! Attaching again ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=428710&aid=688610&group_id=40712 |
From: SourceForge.net <no...@so...> - 2003-02-28 12:32:32
|
Patches item #688610, was opened at 2003-02-18 21:45 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=428710&aid=688610&group_id=40712 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Konstantin Dmitriev (kdmitriev) Assigned to: Nobody/Anonymous (nobody) Summary: Fetch profiles Initial Comment: Here's my code for fetch profiles. No test case is currently developed (though I have my own). I hope you can test on your own model ---------------------------------------------------------------------- Comment By: Cameron Braid (cameronbraid) Date: 2003-02-28 22:42 Message: Logged In: YES user_id=196175 that is most appreciated. Thanks ---------------------------------------------------------------------- Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-02-28 18:39 Message: Logged In: YES user_id=693406 SQL scripts to import test data ---------------------------------------------------------------------- Comment By: Cameron Braid (cameronbraid) Date: 2003-02-28 00:18 Message: Logged In: YES user_id=196175 I would like to try this patch. Though to do so I will need to insert a heap of data.. Do you have a dataset that can be added to the patch ? I suggest that you use DBUnit's flat xml data set as they are quite easy to export / import. ---------------------------------------------------------------------- Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-02-21 18:51 Message: Logged In: YES user_id=693406 Sorry about one-to-one. works now ---------------------------------------------------------------------- Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-02-20 15:49 Message: Logged In: YES user_id=693406 Hello Chris 1. According to Max R. Andersen's request, fetch profiles are defined in a way similar to sessions.setClassFectchProfiles (class1, "property1, property2"); i.e. not in the query 2. The whole thing is not about transparent eager loading lazy-loading proxies. It's about avoiding N+1. Quite different. I suggest you have a look at the patch and test cases Thank you very much for your feedback Best regards, Konstantin Dmitriev ---------------------------------------------------------------------- Comment By: Chris Nokleberg (herbyderby) Date: 2003-02-20 07:41 Message: Logged In: YES user_id=594737 Instead of parsing queries to determine what fields need to be fetched, I suggest that fetch profiles only be allowed for lazy-loading proxies. Accesses to the underlying getters could be intercepted, mapped to a profile, and loaded if necessary. Basically breaking up a lazy entity into distinct subsets of properties, each of which get loaded independently just-in-time. ---------------------------------------------------------------------- Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-02-19 23:53 Message: Logged In: YES user_id=693406 - added support for Maps - added support for Collections of values - various mappings added to the test model: list, map, bag, collection of values, one-to-one, many-to-many, component one-to-one present a problem, because lazy load is not supported ---------------------------------------------------------------------- Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-02-18 22:38 Message: Logged In: YES user_id=693406 Now with the test case. It's for Oracle (Is it a problem?) ---------------------------------------------------------------------- Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-02-18 22:28 Message: Logged In: YES user_id=693406 Where is the archive? Strange! Attaching again ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=428710&aid=688610&group_id=40712 |
From: SourceForge.net <no...@so...> - 2003-03-01 21:10:13
|
Patches item #688610, was opened at 2003-02-18 12:45 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=428710&aid=688610&group_id=40712 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Konstantin Dmitriev (kdmitriev) Assigned to: Nobody/Anonymous (nobody) Summary: Fetch profiles Initial Comment: Here's my code for fetch profiles. No test case is currently developed (though I have my own). I hope you can test on your own model ---------------------------------------------------------------------- >Comment By: Max R. Andersen (maxcsaucdk) Date: 2003-03-01 22:20 Message: Logged In: YES user_id=18119 I've just changed this code to be compilable under hibnerate2. Unfortunately I've not been able to run any tests (yet :), but I thought someone might find it interesting to try under hibnerate2 - and that should be possible now. And just a small question... there is an QueryTranslator in the code - is this fetcher code still dependent on some speciel queyr syntax or is the code just for finding which classes that is being referenced ? ---------------------------------------------------------------------- Comment By: Cameron Braid (cameronbraid) Date: 2003-02-28 13:42 Message: Logged In: YES user_id=196175 that is most appreciated. Thanks ---------------------------------------------------------------------- Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-02-28 09:39 Message: Logged In: YES user_id=693406 SQL scripts to import test data ---------------------------------------------------------------------- Comment By: Cameron Braid (cameronbraid) Date: 2003-02-27 15:18 Message: Logged In: YES user_id=196175 I would like to try this patch. Though to do so I will need to insert a heap of data.. Do you have a dataset that can be added to the patch ? I suggest that you use DBUnit's flat xml data set as they are quite easy to export / import. ---------------------------------------------------------------------- Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-02-21 09:51 Message: Logged In: YES user_id=693406 Sorry about one-to-one. works now ---------------------------------------------------------------------- Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-02-20 06:49 Message: Logged In: YES user_id=693406 Hello Chris 1. According to Max R. Andersen's request, fetch profiles are defined in a way similar to sessions.setClassFectchProfiles (class1, "property1, property2"); i.e. not in the query 2. The whole thing is not about transparent eager loading lazy-loading proxies. It's about avoiding N+1. Quite different. I suggest you have a look at the patch and test cases Thank you very much for your feedback Best regards, Konstantin Dmitriev ---------------------------------------------------------------------- Comment By: Chris Nokleberg (herbyderby) Date: 2003-02-19 22:41 Message: Logged In: YES user_id=594737 Instead of parsing queries to determine what fields need to be fetched, I suggest that fetch profiles only be allowed for lazy-loading proxies. Accesses to the underlying getters could be intercepted, mapped to a profile, and loaded if necessary. Basically breaking up a lazy entity into distinct subsets of properties, each of which get loaded independently just-in-time. ---------------------------------------------------------------------- Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-02-19 14:53 Message: Logged In: YES user_id=693406 - added support for Maps - added support for Collections of values - various mappings added to the test model: list, map, bag, collection of values, one-to-one, many-to-many, component one-to-one present a problem, because lazy load is not supported ---------------------------------------------------------------------- Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-02-18 13:38 Message: Logged In: YES user_id=693406 Now with the test case. It's for Oracle (Is it a problem?) ---------------------------------------------------------------------- Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-02-18 13:28 Message: Logged In: YES user_id=693406 Where is the archive? Strange! Attaching again ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=428710&aid=688610&group_id=40712 |
From: SourceForge.net <no...@so...> - 2003-03-03 08:35:39
|
Patches item #688610, was opened at 2003-02-18 11:45 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=428710&aid=688610&group_id=40712 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Konstantin Dmitriev (kdmitriev) Assigned to: Nobody/Anonymous (nobody) Summary: Fetch profiles Initial Comment: Here's my code for fetch profiles. No test case is currently developed (though I have my own). I hope you can test on your own model ---------------------------------------------------------------------- >Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-03-03 08:45 Message: Logged In: YES user_id=693406 Hello Max Thank you for porting the code to hibernate2 QueryTranslator is used for 2 purposes: to retreive aliases from the query (So that generated aliases do not interfere with existing), and to retreive FROM clause and SELECT clause. Fetcher will then append additional classes and conditions to them. ---------------------------------------------------------------------- Comment By: Max R. Andersen (maxcsaucdk) Date: 2003-03-01 21:20 Message: Logged In: YES user_id=18119 I've just changed this code to be compilable under hibnerate2. Unfortunately I've not been able to run any tests (yet :), but I thought someone might find it interesting to try under hibnerate2 - and that should be possible now. And just a small question... there is an QueryTranslator in the code - is this fetcher code still dependent on some speciel queyr syntax or is the code just for finding which classes that is being referenced ? ---------------------------------------------------------------------- Comment By: Cameron Braid (cameronbraid) Date: 2003-02-28 12:42 Message: Logged In: YES user_id=196175 that is most appreciated. Thanks ---------------------------------------------------------------------- Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-02-28 08:39 Message: Logged In: YES user_id=693406 SQL scripts to import test data ---------------------------------------------------------------------- Comment By: Cameron Braid (cameronbraid) Date: 2003-02-27 14:18 Message: Logged In: YES user_id=196175 I would like to try this patch. Though to do so I will need to insert a heap of data.. Do you have a dataset that can be added to the patch ? I suggest that you use DBUnit's flat xml data set as they are quite easy to export / import. ---------------------------------------------------------------------- Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-02-21 08:51 Message: Logged In: YES user_id=693406 Sorry about one-to-one. works now ---------------------------------------------------------------------- Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-02-20 05:49 Message: Logged In: YES user_id=693406 Hello Chris 1. According to Max R. Andersen's request, fetch profiles are defined in a way similar to sessions.setClassFectchProfiles (class1, "property1, property2"); i.e. not in the query 2. The whole thing is not about transparent eager loading lazy-loading proxies. It's about avoiding N+1. Quite different. I suggest you have a look at the patch and test cases Thank you very much for your feedback Best regards, Konstantin Dmitriev ---------------------------------------------------------------------- Comment By: Chris Nokleberg (herbyderby) Date: 2003-02-19 21:41 Message: Logged In: YES user_id=594737 Instead of parsing queries to determine what fields need to be fetched, I suggest that fetch profiles only be allowed for lazy-loading proxies. Accesses to the underlying getters could be intercepted, mapped to a profile, and loaded if necessary. Basically breaking up a lazy entity into distinct subsets of properties, each of which get loaded independently just-in-time. ---------------------------------------------------------------------- Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-02-19 13:53 Message: Logged In: YES user_id=693406 - added support for Maps - added support for Collections of values - various mappings added to the test model: list, map, bag, collection of values, one-to-one, many-to-many, component one-to-one present a problem, because lazy load is not supported ---------------------------------------------------------------------- Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-02-18 12:38 Message: Logged In: YES user_id=693406 Now with the test case. It's for Oracle (Is it a problem?) ---------------------------------------------------------------------- Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-02-18 12:28 Message: Logged In: YES user_id=693406 Where is the archive? Strange! Attaching again ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=428710&aid=688610&group_id=40712 |
From: SourceForge.net <no...@so...> - 2003-03-03 08:38:41
|
Patches item #688610, was opened at 2003-02-18 11:45 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=428710&aid=688610&group_id=40712 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Konstantin Dmitriev (kdmitriev) Assigned to: Nobody/Anonymous (nobody) Summary: Fetch profiles Initial Comment: Here's my code for fetch profiles. No test case is currently developed (though I have my own). I hope you can test on your own model ---------------------------------------------------------------------- >Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-03-03 08:48 Message: Logged In: YES user_id=693406 Cameron If you got some results from running test cases, could you please share your opinions on fetch profiles? I would be VERY appreciated! Many thanx in advance Best regards Konstantin Dmitriev ---------------------------------------------------------------------- Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-03-03 08:45 Message: Logged In: YES user_id=693406 Hello Max Thank you for porting the code to hibernate2 QueryTranslator is used for 2 purposes: to retreive aliases from the query (So that generated aliases do not interfere with existing), and to retreive FROM clause and SELECT clause. Fetcher will then append additional classes and conditions to them. ---------------------------------------------------------------------- Comment By: Max R. Andersen (maxcsaucdk) Date: 2003-03-01 21:20 Message: Logged In: YES user_id=18119 I've just changed this code to be compilable under hibnerate2. Unfortunately I've not been able to run any tests (yet :), but I thought someone might find it interesting to try under hibnerate2 - and that should be possible now. And just a small question... there is an QueryTranslator in the code - is this fetcher code still dependent on some speciel queyr syntax or is the code just for finding which classes that is being referenced ? ---------------------------------------------------------------------- Comment By: Cameron Braid (cameronbraid) Date: 2003-02-28 12:42 Message: Logged In: YES user_id=196175 that is most appreciated. Thanks ---------------------------------------------------------------------- Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-02-28 08:39 Message: Logged In: YES user_id=693406 SQL scripts to import test data ---------------------------------------------------------------------- Comment By: Cameron Braid (cameronbraid) Date: 2003-02-27 14:18 Message: Logged In: YES user_id=196175 I would like to try this patch. Though to do so I will need to insert a heap of data.. Do you have a dataset that can be added to the patch ? I suggest that you use DBUnit's flat xml data set as they are quite easy to export / import. ---------------------------------------------------------------------- Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-02-21 08:51 Message: Logged In: YES user_id=693406 Sorry about one-to-one. works now ---------------------------------------------------------------------- Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-02-20 05:49 Message: Logged In: YES user_id=693406 Hello Chris 1. According to Max R. Andersen's request, fetch profiles are defined in a way similar to sessions.setClassFectchProfiles (class1, "property1, property2"); i.e. not in the query 2. The whole thing is not about transparent eager loading lazy-loading proxies. It's about avoiding N+1. Quite different. I suggest you have a look at the patch and test cases Thank you very much for your feedback Best regards, Konstantin Dmitriev ---------------------------------------------------------------------- Comment By: Chris Nokleberg (herbyderby) Date: 2003-02-19 21:41 Message: Logged In: YES user_id=594737 Instead of parsing queries to determine what fields need to be fetched, I suggest that fetch profiles only be allowed for lazy-loading proxies. Accesses to the underlying getters could be intercepted, mapped to a profile, and loaded if necessary. Basically breaking up a lazy entity into distinct subsets of properties, each of which get loaded independently just-in-time. ---------------------------------------------------------------------- Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-02-19 13:53 Message: Logged In: YES user_id=693406 - added support for Maps - added support for Collections of values - various mappings added to the test model: list, map, bag, collection of values, one-to-one, many-to-many, component one-to-one present a problem, because lazy load is not supported ---------------------------------------------------------------------- Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-02-18 12:38 Message: Logged In: YES user_id=693406 Now with the test case. It's for Oracle (Is it a problem?) ---------------------------------------------------------------------- Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-02-18 12:28 Message: Logged In: YES user_id=693406 Where is the archive? Strange! Attaching again ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=428710&aid=688610&group_id=40712 |
From: SourceForge.net <no...@so...> - 2003-03-03 16:14:12
|
Patches item #688610, was opened at 2003-02-18 21:45 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=428710&aid=688610&group_id=40712 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Konstantin Dmitriev (kdmitriev) Assigned to: Nobody/Anonymous (nobody) Summary: Fetch profiles Initial Comment: Here's my code for fetch profiles. No test case is currently developed (though I have my own). I hope you can test on your own model ---------------------------------------------------------------------- Comment By: Cameron Braid (cameronbraid) Date: 2003-03-04 02:24 Message: Logged In: YES user_id=196175 Sorry.. I have been busy the last few days. I plan to set this Fetch Profile up within the next few days. One thing that I may need that I don't think that your API does. I will want to be able to have different fetch profiles for each query. ie instead of using a static Fetcher, I will need to have an instance of the Fetcher that I can configure, and execute. (possibly reuse). This way I can generate differnet object graphs for the same query ... ie query 1 requires Product, productdescriptions ie query 2 requires Product, productdescriptions, productgroup, productEmployees does this make sence ? ---------------------------------------------------------------------- Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-03-03 18:48 Message: Logged In: YES user_id=693406 Cameron If you got some results from running test cases, could you please share your opinions on fetch profiles? I would be VERY appreciated! Many thanx in advance Best regards Konstantin Dmitriev ---------------------------------------------------------------------- Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-03-03 18:45 Message: Logged In: YES user_id=693406 Hello Max Thank you for porting the code to hibernate2 QueryTranslator is used for 2 purposes: to retreive aliases from the query (So that generated aliases do not interfere with existing), and to retreive FROM clause and SELECT clause. Fetcher will then append additional classes and conditions to them. ---------------------------------------------------------------------- Comment By: Max R. Andersen (maxcsaucdk) Date: 2003-03-02 07:20 Message: Logged In: YES user_id=18119 I've just changed this code to be compilable under hibnerate2. Unfortunately I've not been able to run any tests (yet :), but I thought someone might find it interesting to try under hibnerate2 - and that should be possible now. And just a small question... there is an QueryTranslator in the code - is this fetcher code still dependent on some speciel queyr syntax or is the code just for finding which classes that is being referenced ? ---------------------------------------------------------------------- Comment By: Cameron Braid (cameronbraid) Date: 2003-02-28 22:42 Message: Logged In: YES user_id=196175 that is most appreciated. Thanks ---------------------------------------------------------------------- Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-02-28 18:39 Message: Logged In: YES user_id=693406 SQL scripts to import test data ---------------------------------------------------------------------- Comment By: Cameron Braid (cameronbraid) Date: 2003-02-28 00:18 Message: Logged In: YES user_id=196175 I would like to try this patch. Though to do so I will need to insert a heap of data.. Do you have a dataset that can be added to the patch ? I suggest that you use DBUnit's flat xml data set as they are quite easy to export / import. ---------------------------------------------------------------------- Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-02-21 18:51 Message: Logged In: YES user_id=693406 Sorry about one-to-one. works now ---------------------------------------------------------------------- Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-02-20 15:49 Message: Logged In: YES user_id=693406 Hello Chris 1. According to Max R. Andersen's request, fetch profiles are defined in a way similar to sessions.setClassFectchProfiles (class1, "property1, property2"); i.e. not in the query 2. The whole thing is not about transparent eager loading lazy-loading proxies. It's about avoiding N+1. Quite different. I suggest you have a look at the patch and test cases Thank you very much for your feedback Best regards, Konstantin Dmitriev ---------------------------------------------------------------------- Comment By: Chris Nokleberg (herbyderby) Date: 2003-02-20 07:41 Message: Logged In: YES user_id=594737 Instead of parsing queries to determine what fields need to be fetched, I suggest that fetch profiles only be allowed for lazy-loading proxies. Accesses to the underlying getters could be intercepted, mapped to a profile, and loaded if necessary. Basically breaking up a lazy entity into distinct subsets of properties, each of which get loaded independently just-in-time. ---------------------------------------------------------------------- Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-02-19 23:53 Message: Logged In: YES user_id=693406 - added support for Maps - added support for Collections of values - various mappings added to the test model: list, map, bag, collection of values, one-to-one, many-to-many, component one-to-one present a problem, because lazy load is not supported ---------------------------------------------------------------------- Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-02-18 22:38 Message: Logged In: YES user_id=693406 Now with the test case. It's for Oracle (Is it a problem?) ---------------------------------------------------------------------- Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-02-18 22:28 Message: Logged In: YES user_id=693406 Where is the archive? Strange! Attaching again ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=428710&aid=688610&group_id=40712 |
From: SourceForge.net <no...@so...> - 2003-03-03 16:31:22
|
Patches item #688610, was opened at 2003-02-18 21:45 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=428710&aid=688610&group_id=40712 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Konstantin Dmitriev (kdmitriev) Assigned to: Nobody/Anonymous (nobody) Summary: Fetch profiles Initial Comment: Here's my code for fetch profiles. No test case is currently developed (though I have my own). I hope you can test on your own model ---------------------------------------------------------------------- Comment By: Cameron Braid (cameronbraid) Date: 2003-03-04 02:41 Message: Logged In: YES user_id=196175 Whoops... Sorry, I just noticed that this example uses sequences... I don't have a database tha t supports sequences. I can look into porting it across to mysql. ---------------------------------------------------------------------- Comment By: Cameron Braid (cameronbraid) Date: 2003-03-04 02:24 Message: Logged In: YES user_id=196175 Sorry.. I have been busy the last few days. I plan to set this Fetch Profile up within the next few days. One thing that I may need that I don't think that your API does. I will want to be able to have different fetch profiles for each query. ie instead of using a static Fetcher, I will need to have an instance of the Fetcher that I can configure, and execute. (possibly reuse). This way I can generate differnet object graphs for the same query ... ie query 1 requires Product, productdescriptions ie query 2 requires Product, productdescriptions, productgroup, productEmployees does this make sence ? ---------------------------------------------------------------------- Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-03-03 18:48 Message: Logged In: YES user_id=693406 Cameron If you got some results from running test cases, could you please share your opinions on fetch profiles? I would be VERY appreciated! Many thanx in advance Best regards Konstantin Dmitriev ---------------------------------------------------------------------- Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-03-03 18:45 Message: Logged In: YES user_id=693406 Hello Max Thank you for porting the code to hibernate2 QueryTranslator is used for 2 purposes: to retreive aliases from the query (So that generated aliases do not interfere with existing), and to retreive FROM clause and SELECT clause. Fetcher will then append additional classes and conditions to them. ---------------------------------------------------------------------- Comment By: Max R. Andersen (maxcsaucdk) Date: 2003-03-02 07:20 Message: Logged In: YES user_id=18119 I've just changed this code to be compilable under hibnerate2. Unfortunately I've not been able to run any tests (yet :), but I thought someone might find it interesting to try under hibnerate2 - and that should be possible now. And just a small question... there is an QueryTranslator in the code - is this fetcher code still dependent on some speciel queyr syntax or is the code just for finding which classes that is being referenced ? ---------------------------------------------------------------------- Comment By: Cameron Braid (cameronbraid) Date: 2003-02-28 22:42 Message: Logged In: YES user_id=196175 that is most appreciated. Thanks ---------------------------------------------------------------------- Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-02-28 18:39 Message: Logged In: YES user_id=693406 SQL scripts to import test data ---------------------------------------------------------------------- Comment By: Cameron Braid (cameronbraid) Date: 2003-02-28 00:18 Message: Logged In: YES user_id=196175 I would like to try this patch. Though to do so I will need to insert a heap of data.. Do you have a dataset that can be added to the patch ? I suggest that you use DBUnit's flat xml data set as they are quite easy to export / import. ---------------------------------------------------------------------- Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-02-21 18:51 Message: Logged In: YES user_id=693406 Sorry about one-to-one. works now ---------------------------------------------------------------------- Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-02-20 15:49 Message: Logged In: YES user_id=693406 Hello Chris 1. According to Max R. Andersen's request, fetch profiles are defined in a way similar to sessions.setClassFectchProfiles (class1, "property1, property2"); i.e. not in the query 2. The whole thing is not about transparent eager loading lazy-loading proxies. It's about avoiding N+1. Quite different. I suggest you have a look at the patch and test cases Thank you very much for your feedback Best regards, Konstantin Dmitriev ---------------------------------------------------------------------- Comment By: Chris Nokleberg (herbyderby) Date: 2003-02-20 07:41 Message: Logged In: YES user_id=594737 Instead of parsing queries to determine what fields need to be fetched, I suggest that fetch profiles only be allowed for lazy-loading proxies. Accesses to the underlying getters could be intercepted, mapped to a profile, and loaded if necessary. Basically breaking up a lazy entity into distinct subsets of properties, each of which get loaded independently just-in-time. ---------------------------------------------------------------------- Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-02-19 23:53 Message: Logged In: YES user_id=693406 - added support for Maps - added support for Collections of values - various mappings added to the test model: list, map, bag, collection of values, one-to-one, many-to-many, component one-to-one present a problem, because lazy load is not supported ---------------------------------------------------------------------- Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-02-18 22:38 Message: Logged In: YES user_id=693406 Now with the test case. It's for Oracle (Is it a problem?) ---------------------------------------------------------------------- Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-02-18 22:28 Message: Logged In: YES user_id=693406 Where is the archive? Strange! Attaching again ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=428710&aid=688610&group_id=40712 |
From: SourceForge.net <no...@so...> - 2003-03-04 05:37:00
|
Patches item #688610, was opened at 2003-02-18 11:45 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=428710&aid=688610&group_id=40712 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Konstantin Dmitriev (kdmitriev) Assigned to: Nobody/Anonymous (nobody) Summary: Fetch profiles Initial Comment: Here's my code for fetch profiles. No test case is currently developed (though I have my own). I hope you can test on your own model ---------------------------------------------------------------------- >Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-03-04 05:47 Message: Logged In: YES user_id=693406 Cameron Certainly, that makes sence. I'm looking for porting the functionality of Fetcher to SessionFactory (global fecth profiles) and Session (session-level fetch profiles) if community approves this patch. Package cirrus.hibernate.fetches is just a temporal package. ---------------------------------------------------------------------- Comment By: Cameron Braid (cameronbraid) Date: 2003-03-03 16:41 Message: Logged In: YES user_id=196175 Whoops... Sorry, I just noticed that this example uses sequences... I don't have a database tha t supports sequences. I can look into porting it across to mysql. ---------------------------------------------------------------------- Comment By: Cameron Braid (cameronbraid) Date: 2003-03-03 16:24 Message: Logged In: YES user_id=196175 Sorry.. I have been busy the last few days. I plan to set this Fetch Profile up within the next few days. One thing that I may need that I don't think that your API does. I will want to be able to have different fetch profiles for each query. ie instead of using a static Fetcher, I will need to have an instance of the Fetcher that I can configure, and execute. (possibly reuse). This way I can generate differnet object graphs for the same query ... ie query 1 requires Product, productdescriptions ie query 2 requires Product, productdescriptions, productgroup, productEmployees does this make sence ? ---------------------------------------------------------------------- Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-03-03 08:48 Message: Logged In: YES user_id=693406 Cameron If you got some results from running test cases, could you please share your opinions on fetch profiles? I would be VERY appreciated! Many thanx in advance Best regards Konstantin Dmitriev ---------------------------------------------------------------------- Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-03-03 08:45 Message: Logged In: YES user_id=693406 Hello Max Thank you for porting the code to hibernate2 QueryTranslator is used for 2 purposes: to retreive aliases from the query (So that generated aliases do not interfere with existing), and to retreive FROM clause and SELECT clause. Fetcher will then append additional classes and conditions to them. ---------------------------------------------------------------------- Comment By: Max R. Andersen (maxcsaucdk) Date: 2003-03-01 21:20 Message: Logged In: YES user_id=18119 I've just changed this code to be compilable under hibnerate2. Unfortunately I've not been able to run any tests (yet :), but I thought someone might find it interesting to try under hibnerate2 - and that should be possible now. And just a small question... there is an QueryTranslator in the code - is this fetcher code still dependent on some speciel queyr syntax or is the code just for finding which classes that is being referenced ? ---------------------------------------------------------------------- Comment By: Cameron Braid (cameronbraid) Date: 2003-02-28 12:42 Message: Logged In: YES user_id=196175 that is most appreciated. Thanks ---------------------------------------------------------------------- Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-02-28 08:39 Message: Logged In: YES user_id=693406 SQL scripts to import test data ---------------------------------------------------------------------- Comment By: Cameron Braid (cameronbraid) Date: 2003-02-27 14:18 Message: Logged In: YES user_id=196175 I would like to try this patch. Though to do so I will need to insert a heap of data.. Do you have a dataset that can be added to the patch ? I suggest that you use DBUnit's flat xml data set as they are quite easy to export / import. ---------------------------------------------------------------------- Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-02-21 08:51 Message: Logged In: YES user_id=693406 Sorry about one-to-one. works now ---------------------------------------------------------------------- Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-02-20 05:49 Message: Logged In: YES user_id=693406 Hello Chris 1. According to Max R. Andersen's request, fetch profiles are defined in a way similar to sessions.setClassFectchProfiles (class1, "property1, property2"); i.e. not in the query 2. The whole thing is not about transparent eager loading lazy-loading proxies. It's about avoiding N+1. Quite different. I suggest you have a look at the patch and test cases Thank you very much for your feedback Best regards, Konstantin Dmitriev ---------------------------------------------------------------------- Comment By: Chris Nokleberg (herbyderby) Date: 2003-02-19 21:41 Message: Logged In: YES user_id=594737 Instead of parsing queries to determine what fields need to be fetched, I suggest that fetch profiles only be allowed for lazy-loading proxies. Accesses to the underlying getters could be intercepted, mapped to a profile, and loaded if necessary. Basically breaking up a lazy entity into distinct subsets of properties, each of which get loaded independently just-in-time. ---------------------------------------------------------------------- Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-02-19 13:53 Message: Logged In: YES user_id=693406 - added support for Maps - added support for Collections of values - various mappings added to the test model: list, map, bag, collection of values, one-to-one, many-to-many, component one-to-one present a problem, because lazy load is not supported ---------------------------------------------------------------------- Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-02-18 12:38 Message: Logged In: YES user_id=693406 Now with the test case. It's for Oracle (Is it a problem?) ---------------------------------------------------------------------- Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-02-18 12:28 Message: Logged In: YES user_id=693406 Where is the archive? Strange! Attaching again ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=428710&aid=688610&group_id=40712 |
From: SourceForge.net <no...@so...> - 2003-03-12 09:12:53
|
Patches item #688610, was opened at 2003-02-18 11:45 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=428710&aid=688610&group_id=40712 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Konstantin Dmitriev (kdmitriev) Assigned to: Nobody/Anonymous (nobody) Summary: Fetch profiles Initial Comment: Here's my code for fetch profiles. No test case is currently developed (though I have my own). I hope you can test on your own model ---------------------------------------------------------------------- >Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-03-12 09:24 Message: Logged In: YES user_id=693406 Does anybody happen to evaluate the patch? Any feedback would be very appreciated even negative one ---------------------------------------------------------------------- Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-03-04 05:47 Message: Logged In: YES user_id=693406 Cameron Certainly, that makes sence. I'm looking for porting the functionality of Fetcher to SessionFactory (global fecth profiles) and Session (session-level fetch profiles) if community approves this patch. Package cirrus.hibernate.fetches is just a temporal package. ---------------------------------------------------------------------- Comment By: Cameron Braid (cameronbraid) Date: 2003-03-03 16:41 Message: Logged In: YES user_id=196175 Whoops... Sorry, I just noticed that this example uses sequences... I don't have a database tha t supports sequences. I can look into porting it across to mysql. ---------------------------------------------------------------------- Comment By: Cameron Braid (cameronbraid) Date: 2003-03-03 16:24 Message: Logged In: YES user_id=196175 Sorry.. I have been busy the last few days. I plan to set this Fetch Profile up within the next few days. One thing that I may need that I don't think that your API does. I will want to be able to have different fetch profiles for each query. ie instead of using a static Fetcher, I will need to have an instance of the Fetcher that I can configure, and execute. (possibly reuse). This way I can generate differnet object graphs for the same query ... ie query 1 requires Product, productdescriptions ie query 2 requires Product, productdescriptions, productgroup, productEmployees does this make sence ? ---------------------------------------------------------------------- Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-03-03 08:48 Message: Logged In: YES user_id=693406 Cameron If you got some results from running test cases, could you please share your opinions on fetch profiles? I would be VERY appreciated! Many thanx in advance Best regards Konstantin Dmitriev ---------------------------------------------------------------------- Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-03-03 08:45 Message: Logged In: YES user_id=693406 Hello Max Thank you for porting the code to hibernate2 QueryTranslator is used for 2 purposes: to retreive aliases from the query (So that generated aliases do not interfere with existing), and to retreive FROM clause and SELECT clause. Fetcher will then append additional classes and conditions to them. ---------------------------------------------------------------------- Comment By: Max R. Andersen (maxcsaucdk) Date: 2003-03-01 21:20 Message: Logged In: YES user_id=18119 I've just changed this code to be compilable under hibnerate2. Unfortunately I've not been able to run any tests (yet :), but I thought someone might find it interesting to try under hibnerate2 - and that should be possible now. And just a small question... there is an QueryTranslator in the code - is this fetcher code still dependent on some speciel queyr syntax or is the code just for finding which classes that is being referenced ? ---------------------------------------------------------------------- Comment By: Cameron Braid (cameronbraid) Date: 2003-02-28 12:42 Message: Logged In: YES user_id=196175 that is most appreciated. Thanks ---------------------------------------------------------------------- Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-02-28 08:39 Message: Logged In: YES user_id=693406 SQL scripts to import test data ---------------------------------------------------------------------- Comment By: Cameron Braid (cameronbraid) Date: 2003-02-27 14:18 Message: Logged In: YES user_id=196175 I would like to try this patch. Though to do so I will need to insert a heap of data.. Do you have a dataset that can be added to the patch ? I suggest that you use DBUnit's flat xml data set as they are quite easy to export / import. ---------------------------------------------------------------------- Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-02-21 08:51 Message: Logged In: YES user_id=693406 Sorry about one-to-one. works now ---------------------------------------------------------------------- Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-02-20 05:49 Message: Logged In: YES user_id=693406 Hello Chris 1. According to Max R. Andersen's request, fetch profiles are defined in a way similar to sessions.setClassFectchProfiles (class1, "property1, property2"); i.e. not in the query 2. The whole thing is not about transparent eager loading lazy-loading proxies. It's about avoiding N+1. Quite different. I suggest you have a look at the patch and test cases Thank you very much for your feedback Best regards, Konstantin Dmitriev ---------------------------------------------------------------------- Comment By: Chris Nokleberg (herbyderby) Date: 2003-02-19 21:41 Message: Logged In: YES user_id=594737 Instead of parsing queries to determine what fields need to be fetched, I suggest that fetch profiles only be allowed for lazy-loading proxies. Accesses to the underlying getters could be intercepted, mapped to a profile, and loaded if necessary. Basically breaking up a lazy entity into distinct subsets of properties, each of which get loaded independently just-in-time. ---------------------------------------------------------------------- Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-02-19 13:53 Message: Logged In: YES user_id=693406 - added support for Maps - added support for Collections of values - various mappings added to the test model: list, map, bag, collection of values, one-to-one, many-to-many, component one-to-one present a problem, because lazy load is not supported ---------------------------------------------------------------------- Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-02-18 12:38 Message: Logged In: YES user_id=693406 Now with the test case. It's for Oracle (Is it a problem?) ---------------------------------------------------------------------- Comment By: Konstantin Dmitriev (kdmitriev) Date: 2003-02-18 12:28 Message: Logged In: YES user_id=693406 Where is the archive? Strange! Attaching again ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=428710&aid=688610&group_id=40712 |
From: Max R. A. <max...@jb...> - 2006-05-28 20:50:24
|
> It occurred to me today that you could avoid my objection just by > defining the fetch profile in its own section of the XML, instead of in > the association mappings. eg. > > <profile name="login"> > <association name="User.roles" fetch="join"/> > <association name="User.orders" fetch="select"/> > </profile> And I guess you really want it disjunct from the mapping and not "just" where the assocation is already defined ? <class name="User"> ... <set name="rules" fetch="select"> ... <profile name="login" fetch="join"/> </set> <set name="orders"> ... <profile name="orders" fetch="select"/> </set> </class> Where the name could actually be comma seperated. Note that this construct doesn't prevent still having a <profile name="login"> as a way to declare the association fetching independent on the declaration and of course the shared things. This is always what I wanted, but I guess good things does comes to the one who waits ;) > Then just call session.setProfile("login"), and all criteria queries, > load(), get() and association fetches would obey the profile. > > Frankly, I feel silly for not have considered to do it that way before. > > The <profile> could also be a good place to make some other things > settable, eg, TX isolation mode, flushmode, TX timeout, etc. > > WDYT? Is it a nice construct? +1 (times all the other times I voted for it ;) -- -- Max Rydahl Andersen callto://max.rydahl.andersen Hibernate ma...@hi... http://hibernate.org JBoss Inc max...@jb... |
From: Christian B. <chr...@jb...> - 2006-06-12 06:16:24
|
On May 28, 2006, at 10:50 PM, Max Rydahl Andersen wrote: > And I guess you really want it disjunct from the mapping and not > "just" where the assocation is already defined ? > > <class name="User"> > ... > <set name="rules" fetch="select"> > ... > <profile name="login" fetch="join"/> > </set> > > <set name="orders"> > ... > <profile name="orders" fetch="select"/> > </set> > </class> > > Where the name could actually be comma seperated. > > Note that this construct doesn't prevent still having a > <profile name="login"> as a way to declare the association fetching > independent on the declaration and of course the shared things. In addition to these fetch profiles, how difficult would it be to expose dynamic cascading profiles? We discussed this several times in the past. IMO this has also been requested a few times and I've seen good use cases in real projects. |