db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Manske, Michael" <Michael.Man...@dat.de>
Subject AW: javaName instead of column name
Date Thu, 03 Apr 2003 10:03:13 GMT
Hi all,

seems as nobody cares that problem :-)
Ok, i will explain why i think that is really important:

Fact 1: object classes are generated as wanted, they use "javaName" in
	and setters()
Fact 2: BasePeer classes uses real column name instead of "javaName"
Fact 3: Criterias for doSelect() in BasePeer classes uses also real column
	Criteria myCrit = new Criteria();
Fact 4: if a column name will change you have to change all sources wich use
doSelect() as shown in Fact 3.

Conclusion: Torque's O/R mapping through peers and the xml-schema
presupposes non-changing clolumn name in database. Torque does not provide
"loose coupling" between java objects and database.

I think this is really bad because you have to change your "persistant"
objects whenever a column name will be renamed in database.

Again: Is this a bug, exists a workaround or i'm doing something wrong with
schema or configuration?


> -----Urspr√ľngliche Nachricht-----
> Von: Manske, Michael 
> Gesendet: Mittwoch, 2. April 2003 18:17
> An: Turbine Torque Users List
> Betreff: javaName instead of column name
> I'm using torque-3.0 and found a problem with use of 
> "javaName" in the base
> peer classes. The object model generation task does not 
> generate "javaName"
> instead of
> real column name in the BaseXPeer classes.
> I'm using the following section in xml-schema:
>     <table name="ADVERT_ADVERT">
>         <column name="ADVERTID" primaryKey="true" required="true"
>             size="19" type="DECIMAL"/>
>         <column name="BEGINDATE" javaName="TEST" 
> required="true" size="14"
> type="VARCHAR"/>
>         <column name="ENDDATE" required="true" size="14" 
> type="VARCHAR"/>
>     </table>
> and get the following lines in the resulting base peer:
>     ...
>     /** the column name for the BEGINDATE field */
>     public static final String BEGINDATE;
>     ...
> It should be "TEST" instead of "BEGINDATE".
> I have played around with "torque.sameJavaName" but without 
> success... 
> Is this a bug or do i something wrong?
> Thanks,
> Michael
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-user-help@db.apache.org

View raw message