cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Grzegorz Kossakowski <g...@tuffmail.com>
Subject Re: How to get Avalon Component from Bean?
Date Sat, 24 Feb 2007 23:32:13 GMT
Dev at weitling napisaƂ(a):
> Hi,
>
> I have a Java Bean bound to a CForm. Now I have several problems (and
> questions :-):
>
> 1) How to I get an (avalon) component out of that POJO Java class e.g.
> to get a defined SQL connection?
>
> 2) How can I determine when a form.load or form.save call from a
> flowscript will end? An example: A Table with name, street and city. A
> corresponding bean with getName(), setName()... A CForm with three text
> fields.  But on form.load() a call to getName(), getStreet() and
> getCity() is done. I don't want to have it three SQL calls.
>   
I think you are trying to reinvent the wheel here. Do I understand you 
correctly that you want your POJO to handle SQL queries? Why don't you 
just load it by some other class and stay clean with your POJO class? 
Maybe because of lazy loading?
To respond your queries, I think it's not possible and moreover IMO it 
should not be possible to do things you ask for.
> 3) Why is there always a load() performed on a save() call? And not just
> once but this way: get, set, get, get. Mysterious.
>   
I think binding code tries to find out which values were changed and 
bind only if something was changed. That should explain why get is called.
> I hope this is more clear than my other postings ;-)
>
>   
It's good that you ask specific questions but you should also include 
few sentences describing what you want to achieve because it may be that 
you just try to do something in wrong way.

-- 
Grzegorz Kossakowski

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message