Yes you can change the Object.vm file in the /templates/om/ folder.
By chaging this file you can add your own method to classes generated.

Sample :

Add the code belown

#if($cjtype == "String")
/**
 * Retourne la taille maximale du champs $cfc en DB 
 * 
 * @return int
 */
        public static int 
        get${cfc}FieldSize()
        {
                return $col.Size;
        }     
#end


This method will ad a method getXXXFieldSize where XXX is the name of an
object attribute.

Guillaume

-----Original Message-----
From: Geoff Fortytwo [mailto:[EMAIL PROTECTED]]
Sent: Monday, June 10, 2002 7:25 PM
To: Turbine Torque Users List'
Subject: max column size


In the schema for a project I specify the maximum size of all the fields. 
Is there a way to get that information at runtime?

For instance, take the following schema table:
   <table name="UserGameReview" javaName="UserGameReview" idMethod="none" 
skipSql="true">
     <column 
name="id"          javaName="Id"          required="true"  type="INTEGER" 
size="10"/>
     <column name="review"      javaName="Review"      required="false" 
type="VARCHAR" size="500"/>
   </table>

Is there a way, to do something like:
   UserGameReviewPeer.getMaxSizeOfReview() or 
UserGameReviewPeer.getMaxSize(UserGameReviewPeer.REVIEW)
such that that function would return 500 (because that's what's specified 
in the schema).


--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>

Reply via email to