commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Graham <grahamdavid1...@yahoo.com>
Subject Re: DbUtils question
Date Wed, 03 Dec 2003 15:44:19 GMT

--- Emerson Cargnin <emerson@tre-sc.gov.br> wrote:
> I'm giving my first steps into dbutils, and i'd like to make a question,
> 
> since the docs are still  small:
> 
> What's the mapping from the db field names and the get/set properties of
> 
> my bean (the one sent to the sqlrunner).
> 
> an example :
> 
> if I have a sql command
> select * from mytable
> 
> my table has two fields :
> 
> id
> id_othertable
> 
> What's are the allowed get/set mapping to get the bean with all the 
> properties of the resultset.
> 
> it can translate from id_company to setCompany ?? or I have to use the 
> 'as', modifying all the sql's?

You should use an SQL "AS" to change the column names to match your bean
property names.  Your id column would call setId() on your bean.  I'm not
sure about id_othertable because it contains an underscore but it should
call setId_othertable.

David

> 
> Anyone could show me some complete examples???
> 
> Thanks and congratulation for this excellent tool.
> 
> 
> -- 
> Emerson Cargnin
> Analista de Sistemas
> Setor de Desenvolvimento de Sistemas - TRE-SC
> tel : (048) - 251-3700 - Ramal 3181
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
> 


__________________________________
Do you Yahoo!?
Free Pop-Up Blocker - Get it now
http://companion.yahoo.com/

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


Mime
View raw message