You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-user@db.apache.org by au...@email.de on 2006/12/17 19:04:15 UTC

Metainformation of table

Hey ...

how can i get all meta information of a table, for example the column names!? with pure mysql i can do that with ResultSetMetaData meta = rs.getMetaData(); ...

thanks,
aunts

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


RE: Metainformation of table

Posted by Greg Monroe <Gr...@DukeCE.com>.
Torque meta info is contained in the Map classes.

You can get the TableMap object via getTableMap() 
methods in both the Peer or Record objects.  
This contains ColumnMap objects (and other linked
info) with Column specific names.

However, for convenience, the Java column names
are also contained in an array property of the
Record objects.  These can be used with the
getByName/setByName methods to quickly walk
thru the object values.

One "gotcha" with the Map data to be aware of is
that the DatabaseMap structure which holds the
TableMap objects is populated only if a Table
peer object is created. If you need to ensure
that the DatabaseMap object has all the tables,
you have to call it's initialize() method.

See the Javadocs for the possible problems with
this method.

> -----Original Message-----
> From: aunts@email.de [mailto:aunts@email.de] 
> Sent: Sunday, December 17, 2006 1:04 PM
> To: torque-user@db.apache.org
> Subject: Metainformation of table
> 
> Hey ...
> 
> how can i get all meta information of a table, for example 
> the column names!? with pure mysql i can do that with 
> ResultSetMetaData meta = rs.getMetaData(); ...
> 
> thanks,
> aunts
> 
> ---------------------------------------------------------------------
> 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