Re: [Hibernate] Fetch profiles

2006-06-12 Thread Christian Bauer

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.



___
hibernate-devel mailing list
hibernate-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hibernate-devel


Re: [Hibernate] Fetch profiles

2006-05-28 Thread Max Rydahl Andersen

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
[EMAIL PROTECTED]
http://hibernate.org

JBoss Inc
[EMAIL PROTECTED]


---
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnkkid=107521bid=248729dat=121642
___
hibernate-devel mailing list
hibernate-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hibernate-devel


RE: [Hibernate] Fetch profiles

2006-05-28 Thread Gavin King
Exactly.

-Original Message-
From: Max Andersen 

 And I guess you really want it disjunct from the mapping and not
just  
 where the assocation is already defined ?


---
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnkkid7521bid$8729dat1642
___
hibernate-devel mailing list
hibernate-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hibernate-devel


Re: [Hibernate] Fetch profiles

2006-05-28 Thread Max Rydahl Andersen

and if that is what it takes, then let that be it ;)

/max


Exactly.

-Original Message-
From: Max Andersen


And I guess you really want it disjunct from the mapping and not

just

where the assocation is already defined ?




--
--
Max Rydahl Andersen
callto://max.rydahl.andersen

Hibernate
[EMAIL PROTECTED]
http://hibernate.org

JBoss Inc
[EMAIL PROTECTED]


---
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnkkid=107521bid=248729dat=121642
___
hibernate-devel mailing list
hibernate-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hibernate-devel