ibatis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jgbut...@apache.org
Subject svn commit: r836419 - /ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/xmlmapper/elements/AbstractXmlElementGenerator.java
Date Sun, 15 Nov 2009 20:50:39 GMT
Author: jgbutler
Date: Sun Nov 15 20:50:38 2009
New Revision: 836419

URL: http://svn.apache.org/viewvc?rev=836419&view=rev
Log:
[ibator] fix selectkey for ibatis3

Modified:
    ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/xmlmapper/elements/AbstractXmlElementGenerator.java

Modified: ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/xmlmapper/elements/AbstractXmlElementGenerator.java
URL: http://svn.apache.org/viewvc/ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/xmlmapper/elements/AbstractXmlElementGenerator.java?rev=836419&r1=836418&r2=836419&view=diff
==============================================================================
--- ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/xmlmapper/elements/AbstractXmlElementGenerator.java
(original)
+++ ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis3/xmlmapper/elements/AbstractXmlElementGenerator.java
Sun Nov 15 20:50:38 2009
@@ -54,7 +54,13 @@
         answer.addAttribute(new Attribute(
                 "keyProperty", introspectedColumn.getJavaProperty())); //$NON-NLS-1$
         if(StringUtility.stringHasValue(generatedKey.getType())) {
-          answer.addAttribute(new Attribute("type", generatedKey.getType())); //$NON-NLS-1$
 
+            if ("pre".equalsIgnoreCase(generatedKey.getType())) { //$NON-NLS-1$
+                answer.addAttribute(new Attribute("order", "BEFORE")); //$NON-NLS-1$ //$NON-NLS-2$
 
+            } else if ("post".equalsIgnoreCase(generatedKey.getType())) { //$NON-NLS-1$
+                answer.addAttribute(new Attribute("order", "AFTER")); //$NON-NLS-1$ //$NON-NLS-2$
 
+            } else {
+                answer.addAttribute(new Attribute("order", generatedKey.getType())); //$NON-NLS-1$
 
+            }
         }
         answer.addElement(new TextElement(generatedKey.getRuntimeSqlStatement()));
     



Mime
View raw message