Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/tools/codegen
In directory usw-pr-cvs1:/tmp/cvs-serv7273/hibernate/tools/codegen
Modified Files:
BasicRenderer.java
Log Message:
integrated Aapo Laakkonen's patch to allow isFoo-style getters for boolean properties
enabled order-by attribute for bags in JDK<1.4
Index: BasicRenderer.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/tools/codegen/BasicRenderer.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** BasicRenderer.java 2 Nov 2002 15:48:54 -0000 1.12
--- BasicRenderer.java 8 Nov 2002 23:49:47 -0000 1.13
***************
*** 2,11 ****
package cirrus.hibernate.tools.codegen;
-
import java.io.PrintWriter;
import java.util.Iterator;
import java.util.Map;
-
public class BasicRenderer implements Renderer {
--- 2,9 ----
***************
*** 14,18 ****
* that it will return the Proxy for the class name if the class was
* defined with a proxy attribute.
! * @param name class name that we use to serach in class2classmap
* @param class2classmap a map from classname to classmappings
* @return String return either name or the proxy name of the classmap
--- 12,16 ----
* that it will return the Proxy for the class name if the class was
* defined with a proxy attribute.
! * @param field class name that we use to serach in class2classmap
* @param class2classmap a map from classname to classmappings
* @return String return either name or the proxy name of the classmap
***************
*** 142,147 ****
field = (Field) fields.next();
// getter
! writer.println(" public " + getTrueTypeName(field, class2classmap) + " get" + field.getAsSuffix() + "() {");
writer.println(" return this." + field.getName() + ";");
writer.println(" }");
--- 140,147 ----
field = (Field) fields.next();
+ String getterType = (field.getType().toLowerCase().equals("boolean")) ? " is" : " get";
+
// getter
! writer.println(" public " + getTrueTypeName(field, class2classmap) + getterType + field.getAsSuffix() + "() {");
writer.println(" return this." + field.getName() + ";");
writer.println(" }");
|