Re: Generics and SortableDataProvider

2009-10-06 Thread Sven Meier

Hi Jonny,

yes, it works exactly like you described it.

Sven

jwray wrote:

Hi Sven,

Thanks for your reply. Since I sent the original question I ended up doing
what you suggested and now I'm wondering why I ever used the id projection
approach. Habit I guess, formed with previous frameworks. 


Just to make sure I've got this right, as long as I use a DetachableModel as
a return from model method, the domain objects aren't stored in the session
even if they are returned from the iterator. Am I correct in this?

Jonny


svenmeier wrote:
  

Hi John,

I believe the consensus on this list is that you should change your 
approach:


Why don't you just iterate over your domain objects in the first place? 
They will be loaded anyway to be displayed on your component. So your 
approach triggers 1+n selects instead of 1 select for all required 
objects at once.


Sven




  



-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Generics and SortableDataProvider

2009-10-05 Thread Jonny.Wray
Hi,

 

Working on my first application using 1.4.x and generics and have a
question regarding the use of SortableDataProvider. Within my extensions
of this class I quite commonly obtain the id of an object within the
iterator method and then load the object via a LoadableDetchableModel
within the model method. 

 

My question is how to implement such an approach using the new generic
classes. For example, the generic model method has the signature public
IModelT  model(T object) but using the id based approach I would pass
in a Long and return a model containing my domain model. The signature
assumes the method parameter and model returned operate on the same
type.

 

Anyone tell me what I'm missing or if my approach is flawed?

 

Thanks,

Jonny
 


This email message and any attached files are for the sole use of the intended 
recipient(s) and may contain confidential and privileged information. Any 
unauthorized review, use, disclosure or distribution of this email message is 
prohibited. If you are not the intended recipient, please inform the sender by 
reply email and destroy all copies of the original message and your reply. If 
you are the intended recipient, please be advised that the content of this 
message is subject to access, review and disclosure by the sender's Email 
System Administrator.


Re: Generics and SortableDataProvider

2009-10-05 Thread Sven Meier

Hi John,

I believe the consensus on this list is that you should change your 
approach:


Why don't you just iterate over your domain objects in the first place? 
They will be loaded anyway to be displayed on your component. So your 
approach triggers 1+n selects instead of 1 select for all required 
objects at once.


Sven


jonny.w...@fiveprime.com wrote:

Hi,

Working on my first application using 1.4.x and generics and have a
question regarding the use of SortableDataProvider. Within my extensions
of this class I quite commonly obtain the id of an object within the
iterator method and then load the object via a LoadableDetchableModel
within the model method. 


My question is how to implement such an approach using the new generic
classes. For example, the generic model method has the signature public
IModelT  model(T object) but using the id based approach I would pass
in a Long and return a model containing my domain model. The signature
assumes the method parameter and model returned operate on the same
type.

Anyone tell me what I'm missing or if my approach is flawed?

Thanks,

Jonny
 



This email message and any attached files are for the sole use of the intended 
recipient(s) and may contain confidential and privileged information. Any 
unauthorized review, use, disclosure or distribution of this email message is 
prohibited. If you are not the intended recipient, please inform the sender by 
reply email and destroy all copies of the original message and your reply. If 
you are the intended recipient, please be advised that the content of this 
message is subject to access, review and disclosure by the sender's Email 
System Administrator


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Generics and SortableDataProvider

2009-10-05 Thread jwray


Hi Sven,

Thanks for your reply. Since I sent the original question I ended up doing
what you suggested and now I'm wondering why I ever used the id projection
approach. Habit I guess, formed with previous frameworks. 

Just to make sure I've got this right, as long as I use a DetachableModel as
a return from model method, the domain objects aren't stored in the session
even if they are returned from the iterator. Am I correct in this?

Jonny


svenmeier wrote:
 
 Hi John,
 
 I believe the consensus on this list is that you should change your 
 approach:
 
 Why don't you just iterate over your domain objects in the first place? 
 They will be loaded anyway to be displayed on your component. So your 
 approach triggers 1+n selects instead of 1 select for all required 
 objects at once.
 
 Sven
 

-- 
View this message in context: 
http://www.nabble.com/Generics-and-SortableDataProvider-tp25757590p25761751.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org