Return-Path: Delivered-To: apmail-db-torque-dev-archive@www.apache.org Received: (qmail 52198 invoked from network); 5 Aug 2006 11:46:45 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 5 Aug 2006 11:46:45 -0000 Received: (qmail 13620 invoked by uid 500); 5 Aug 2006 11:46:44 -0000 Delivered-To: apmail-db-torque-dev-archive@db.apache.org Received: (qmail 13601 invoked by uid 500); 5 Aug 2006 11:46:44 -0000 Mailing-List: contact torque-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Apache Torque Developers List" Reply-To: "Apache Torque Developers List" Delivered-To: mailing list torque-dev@db.apache.org Received: (qmail 13590 invoked by uid 500); 5 Aug 2006 11:46:44 -0000 Received: (qmail 13587 invoked by uid 99); 5 Aug 2006 11:46:44 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 05 Aug 2006 04:46:44 -0700 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [140.211.166.113] (HELO eris.apache.org) (140.211.166.113) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 05 Aug 2006 04:46:44 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 11AB61A981A; Sat, 5 Aug 2006 04:46:24 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r428988 - in /db/torque: runtime/trunk/src/java/org/apache/torque/map/ColumnMap.java templates/trunk/src/templates/om/MapBuilder.vm Date: Sat, 05 Aug 2006 11:46:23 -0000 To: torque-commits@db.apache.org From: tfischer@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20060805114624.11AB61A981A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: tfischer Date: Sat Aug 5 04:46:23 2006 New Revision: 428988 URL: http://svn.apache.org/viewvc?rev=428988&view=rev Log: It was not possible until now to find out the Torque Type (aka schema type) of a column during the runtime. This is now possible. Improves upon TORQUE-22. Modified: db/torque/runtime/trunk/src/java/org/apache/torque/map/ColumnMap.java db/torque/templates/trunk/src/templates/om/MapBuilder.vm Modified: db/torque/runtime/trunk/src/java/org/apache/torque/map/ColumnMap.java URL: http://svn.apache.org/viewvc/db/torque/runtime/trunk/src/java/org/apache/torque/map/ColumnMap.java?rev=428988&r1=428987&r2=428988&view=diff ============================================================================== --- db/torque/runtime/trunk/src/java/org/apache/torque/map/ColumnMap.java (original) +++ db/torque/runtime/trunk/src/java/org/apache/torque/map/ColumnMap.java Sat Aug 5 04:46:23 2006 @@ -38,9 +38,12 @@ /** The serialVersionUID for this class. */ private static final long serialVersionUID = -5971184507395399165L; - /** Type of the column. */ + /** A sample object having the same java Type as the column. */ private Object type = null; + /** The name of the Torque Type of the column. */ + private String torqueType = null; + /** Should object type be converted to primitive. */ private boolean usePrimitive = true; @@ -184,6 +187,16 @@ } /** + * Set the Torque type of this column. + * + * @param torqueType the Torque type of the column. + */ + public void setTorqueType(String torqueType) + { + this.torqueType = torqueType; + } + + /** * Set the size of this column. * * @param size An int specifying the size. @@ -265,6 +278,16 @@ public Object getType() { return type; + } + + /** + * Get the name of the Torque type of this column. + * + * @return The name of the Torque type of this column. + */ + public String getTorqueType() + { + return torqueType; } /** Modified: db/torque/templates/trunk/src/templates/om/MapBuilder.vm URL: http://svn.apache.org/viewvc/db/torque/templates/trunk/src/templates/om/MapBuilder.vm?rev=428988&r1=428987&r2=428988&view=diff ============================================================================== --- db/torque/templates/trunk/src/templates/om/MapBuilder.vm (original) +++ db/torque/templates/trunk/src/templates/om/MapBuilder.vm Sat Aug 5 04:46:23 2006 @@ -136,6 +136,7 @@ // ------------- Column: $cup -------------------- cMap = new ColumnMap( "$cnm", tMap); cMap.setType( $col.JavaObject ); + cMap.setTorqueType( "$col.Domain.Type.Name" ); cMap.setUsePrimitive($col.UsePrimitive); cMap.setPrimaryKey($col.isPrimaryKey()); cMap.setNotNull($col.isNotNull()); --------------------------------------------------------------------- To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org For additional commands, e-mail: torque-dev-help@db.apache.org