db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Greg Monroe" <Greg.Mon...@DukeCE.com>
Subject RE: Beans & Objects
Date Wed, 14 Dec 2005 22:11:50 GMT
It sounds like Axis wants to use Index Property beans to manage 
bean "collections".  An index property is defined by the JavaBean
spec to have methods like:

Property[] getProperty()
Property getProperty(int index)

and some others.

The quick fix for this might be to expand the torque-gen-templates*
jar file and look thru the templates in the bean directory.  These
are the template files that create the beans code.  You probably 
could add in an extra method or two to make life easier with Axis.
I'd add not replace to limit possible problems with a missing 
method.

I've occationally thought about seeing what's involved to create
a matching "collection" bean for each record bean.  I use 
Dreamweaver to do GUI layouts and it has some simple app development
capablities that can use a collection bean as a datasource. 

So you would have TableBean and TableCollectionBean and be able to
do something like:  new TableCollectionBean(Criteria c) and use 
the indexed property methods to get record beans.  

Of course, the downside is that you have to load the entire response
into memory at once.  The up side (at least for me) is that I can
use DW's app tools like coding drop downs populated from these beans.

Maybe someday I'll find the time.



> -----Original Message-----
> From: Trey Long 
> 
> 
> I wrote about a similar idea a few messages ago when it comes to 
> relationships in a table. As a recap I am using Axis + Torque 
> to give my 
> database web service wings as it were.
> 
> Axis generates a WSDL for me, but if I expect it to be 
> anything close to 
> coherent I need to use strong typing with something like an 
> Array. When 
> the beans are generated they are nice enough to give me methods like 
> 'getEmployeeBeans()' which will retrieve a collection of 
> beans that are 
> related to the current bean.
> 
> class BaseCompanyBean {
>     protected List collEmployeeBeans;
>     public List getEmployeeBeans()    {
>         return collEmployeeBeans;
>     }
> }
> 
> My question is: Is there a way, either by torque generator 
> configuration 
> or a good place to start in the generator source, a way to 
> strictly type 
> 'List colEmployeeBeans' to 'EmployeeBeans[]'? I am not interested in 
> forcing torque to use an array over a list, what I would like 
> to do is 
> have perhaps an additional variable inside the base class or even the 
> super class that contains EmployeeBeans[] so that when I 
> point Axis to 
> it I get a decent WSDL and avoid having to add a wrapper 
> method to every 
> Object generated by torque (that's a lot).
> 
> I am looking for a little direction from you guys who know 
> quite a bit 
> about torque. Maybe I am barking up the wrong tree, maybe it's just 
> something that torque hasn't made it to yet. Regardless, any advice 
> would be great.
> 
> If you don't understand my example let me know, I can try to make it 
> clearer.
> 
> Thanks, -James
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-user-help@db.apache.org
> 
> 

Duke CE Privacy Statement
Please be advised that this e-mail and any files transmitted with it are confidential communication
or may otherwise be privileged or confidential and are intended solely for the individual
or entity to whom they are addressed.  If you are not the intended recipient you may not rely
on the contents of this email or any attachments, and we ask that you  please not read, copy
or retransmit this communication, but reply to the sender and destroy the email, its contents,
and all copies thereof immediately.  Any unauthorized dissemination, distribution or copying
of this communication is strictly prohibited.



---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Mime
View raw message