Update of /cvsroot/xdoclet/xdoclet/modules/hibernate/src/xdoclet/modules/hibernate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17165/modules/hibernate/src/xdoclet/modules/hibernate
Modified Files: HibernateTagsHandler.java Log Message: XDT-1257: allow for standard hibernate type names in id tag Index: HibernateTagsHandler.java =================================================================== RCS file: /cvsroot/xdoclet/xdoclet/modules/hibernate/src/xdoclet/modules/hibernate/HibernateTagsHandler.java,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -r1.41 -r1.42 *** HibernateTagsHandler.java 4 May 2005 18:56:12 -0000 1.41 --- HibernateTagsHandler.java 1 Jun 2005 16:08:10 -0000 1.42 *************** *** 8,11 **** --- 8,12 ---- import java.util.Iterator; import java.util.LinkedList; + import java.util.List; import java.util.Properties; *************** *** 14,18 **** --- 15,21 ---- import xjavadoc.XClass; + import xjavadoc.XDoc; import xjavadoc.XMethod; + import xjavadoc.XProgramElement; import xdoclet.DocletContext; import xdoclet.DocletSupport; *************** *** 24,27 **** --- 27,31 ---- import xdoclet.util.LogUtil; import xdoclet.util.Translator; + /** * Specific tags handler to make the template easy. *************** *** 696,700 **** // decide whether we have composite or primitive ID ! boolean isPrimitive = TypeTagsHandler.isPrimitiveType(typeStr) || "java.lang.Byte".equals(typeStr) || "java.lang.Double".equals(typeStr) || --- 700,705 ---- // decide whether we have composite or primitive ID ! boolean isPrimitive = typeClass == null || ! TypeTagsHandler.isPrimitiveType(typeStr) || "java.lang.Byte".equals(typeStr) || "java.lang.Double".equals(typeStr) || *************** *** 708,711 **** --- 713,741 ---- isUserType; + if (!isPrimitive && typeClass != null) { + // assume the type is primitive unless we can positively + // verify that there are property tags in the class + isPrimitive = true; + + List elements = new LinkedList(typeClass.getFields()); + + elements.addAll(typeClass.getMethods()); + + Iterator i = elements.iterator(); + + while (i.hasNext()) { + XProgramElement element = (XProgramElement) i.next(); + XDoc doc = element.getDoc(); + + if (doc.hasTag("hibernate.key-property") || + doc.hasTag("hibernate.key-many-to-one") || + doc.hasTag("hibernate.property") || + doc.hasTag("hibernate.many-to-one")) { + isPrimitive = false; + break; + } + } + } + if (isPrimitive && !composite) { setCurrentMethod(method); ------------------------------------------------------- This SF.Net email is sponsored by Yahoo. Introducing Yahoo! Search Developer Network - Create apps using Yahoo! Search APIs Find out how you can build Yahoo! directly into your own Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005 _______________________________________________ xdoclet-devel mailing list xdoclet-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xdoclet-devel