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 Rafael Coscolla <rc...@tissat.es> on 2003/10/17 09:10:28 UTC

Dependency between Torque and Database Fields

    Hi everyone,

    after using torqe for a month i've found that it has a dependence between the database field names and the code generated.

    Le t me explain you my doubt with an example:


    In the torque site documentation we can find that the way to serach for an object, with an especific atribute value is:
Criteria crit = new Criteria();
crit.add(BookPeer.ISBN, "0-618-12902-2");
List v = BookPeer.doSelect(crit);

    Where ISBN is the field name of the Books Table, that seems to lead to a dependency between your code and the Database.
In the case the field name has to be changed in the database, we will have to look for all the references of this field in our code and replace them manually. ¿Does anyone 
know a different way for retriving the selected Books without refer the database fields in my code?
    When a first read abount torqe, and began to use it, i expected that the reference, in the peer objects, for the table field in the code will be through the javanName 
value expecified in the XML schema file, used to describe the database, as it is done in the get and set methods of the atributes in the BaseObjects. ¿Does anyone know 
if this is reported as a Bug and if its going to be fixed?
    Thanks in advance.