svn commit: r663717 [2/2] - in /ibatis/trunk/java/tools/ibator/core: build/ doc/ htmldoc/ htmldoc/configreference/ src/org/apache/ibatis/ibator/ant/ src/org/apache/ibatis/ibator/api/ src/org/apache/ib

2008-06-05 Thread jgbutler
Modified: 
ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/internal/java/model/JavaModelGeneratorJava2Impl.java
URL: 
http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/internal/java/model/JavaModelGeneratorJava2Impl.java?rev=663717r1=663716r2=663717view=diff
==
--- 
ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/internal/java/model/JavaModelGeneratorJava2Impl.java
 (original)
+++ 
ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/internal/java/model/JavaModelGeneratorJava2Impl.java
 Thu Jun  5 12:40:22 2008
@@ -87,23 +87,10 @@
  */
 protected Properties properties;
 
-/**
- * The target package from the JavaModelGenerator congiguration element
- */
-protected String targetPackage;
-
-/**
- * The target project from the JavaModelGenerator congiguration element
- */
-protected String targetProject;
-
-private MapFullyQualifiedTable, MapString, Object tableValueMaps;
-
 private MapString, PropertyDescriptor[] propertyDescriptorMap;
 
 public JavaModelGeneratorJava2Impl() {
 super();
-tableValueMaps = new HashMapFullyQualifiedTable, MapString, 
Object();
 properties = new Properties();
 propertyDescriptorMap = new HashMapString, PropertyDescriptor[]();
 }
@@ -112,25 +99,6 @@
 this.properties.putAll(properties);
 }
 
-/*
- * (non-Javadoc)
- * 
- * @see 
org.apache.ibatis.ibator.api.JavaModelGenerator#setTargetPackage(java.lang.String)
- */
-public void setTargetPackage(String targetPackage) {
-this.targetPackage = targetPackage;
-}
-
-private MapString, Object getTableValueMap(FullyQualifiedTable table) {
-MapString, Object map = tableValueMaps.get(table);
-if (map == null) {
-map = new HashMapString, Object();
-tableValueMaps.put(table, map);
-}
-
-return map;
-}
-
 /**
  * Adds fields and getter/setter methods for each ColumnDefinition passed
  * into the method.
@@ -231,40 +199,14 @@
 }
 }
 
-/**
- * Calculates the package for generated domain objects.
- * 
- * @param table
- *the current table
- * @return the calculated package
- */
-protected String getJavaModelPackage(FullyQualifiedTable table) {
-String key = getJavaModelPackage; //$NON-NLS-1$
-String s;
-
-MapString, Object map = getTableValueMap(table);
-s = (String) map.get(key);
-if (s == null) {
-StringBuffer sb = new StringBuffer(targetPackage);
-if 
(true.equalsIgnoreCase(properties.getProperty(PropertyRegistry.ANY_ENABLE_SUB_PACKAGES)))
 { //$NON-NLS-1$
-sb.append(table.getSubPackage());
-}
-
-s = sb.toString();
-map.put(key, s);
-}
-
-return s;
-}
-
 protected TopLevelClass getPrimaryKey(IntrospectedTable introspectedTable) 
{
 
 if (!introspectedTable.getRules().generatePrimaryKeyClass()) {
 return null;
 }
 
-FullyQualifiedTable table = introspectedTable.getTable();
-FullyQualifiedJavaType type = getPrimaryKeyType(table);
+FullyQualifiedTable table = introspectedTable.getFullyQualifiedTable();
+FullyQualifiedJavaType type = introspectedTable.getPrimaryKeyType();
 TopLevelClass answer = new TopLevelClass(type);
 answer.setVisibility(JavaVisibility.PUBLIC);
 ibatorContext.getCommentGenerator().addJavaFileComment(answer);
@@ -287,14 +229,14 @@
 return null;
 }
 
-FullyQualifiedTable table = introspectedTable.getTable();
-FullyQualifiedJavaType type = getBaseRecordType(table);
+FullyQualifiedTable table = introspectedTable.getFullyQualifiedTable();
+FullyQualifiedJavaType type = introspectedTable.getBaseRecordType();
 TopLevelClass answer = new TopLevelClass(type);
 answer.setVisibility(JavaVisibility.PUBLIC);
 ibatorContext.getCommentGenerator().addJavaFileComment(answer);
 
 if (introspectedTable.getRules().generatePrimaryKeyClass()) {
-answer.setSuperClass(getPrimaryKeyType(table));
+answer.setSuperClass(introspectedTable.getPrimaryKeyType());
 } else {
 String rootClass = getRootClass(introspectedTable);
 if (rootClass != null) {
@@ -327,16 +269,16 @@
 return null;
 }
 
-FullyQualifiedTable table = introspectedTable.getTable();
-FullyQualifiedJavaType type = getRecordWithBLOBsType(table);
+FullyQualifiedTable table = introspectedTable.getFullyQualifiedTable();
+FullyQualifiedJavaType type = 
introspectedTable.getRecordWithBLOBsType();
 TopLevelClass answer = new 

svn commit: r663718 - /ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/internal/db/IntrospectedTableDefaultImpl.java

2008-06-05 Thread jgbutler
Author: jgbutler
Date: Thu Jun  5 12:48:52 2008
New Revision: 663718

URL: http://svn.apache.org/viewvc?rev=663718view=rev
Log:
ibator: many changes to improve extensibility and enable future refactorings

Modified:

ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/internal/db/IntrospectedTableDefaultImpl.java

Modified: 
ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/internal/db/IntrospectedTableDefaultImpl.java
URL: 
http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/internal/db/IntrospectedTableDefaultImpl.java?rev=663718r1=663717r2=663718view=diff
==
--- 
ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/internal/db/IntrospectedTableDefaultImpl.java
 (original)
+++ 
ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/internal/db/IntrospectedTableDefaultImpl.java
 Thu Jun  5 12:48:52 2008
@@ -41,11 +41,11 @@
  */
 public class IntrospectedTableDefaultImpl implements IntrospectedTable {
 
-private TableConfiguration tableConfiguration;
-private ColumnDefinitions columnDefinitions;
-private FullyQualifiedTable fullyQualifiedTable;
+protected TableConfiguration tableConfiguration;
+protected ColumnDefinitions columnDefinitions;
+protected FullyQualifiedTable fullyQualifiedTable;
+protected IbatorContext ibatorContext;
 private IbatorRules rules;
-private IbatorContext ibatorContext;
 
 /**
  * 
@@ -97,11 +97,11 @@
 public IbatorRules getRules() {
 if (rules == null) {
 if (tableConfiguration.getModelType() == ModelType.HIERARCHICAL) {
-this.rules = new HierarchicalModelRules(tableConfiguration, 
this);
+rules = new HierarchicalModelRules(tableConfiguration, this);
 } else if (tableConfiguration.getModelType() == ModelType.FLAT) {
-this.rules = new FlatModelRules(tableConfiguration, this);
+rules = new FlatModelRules(tableConfiguration, this);
 } else {
-this.rules = new ConditionalModelRules(tableConfiguration, 
this);
+rules = new ConditionalModelRules(tableConfiguration, this);
 }
 }
 




svn commit: r663728 - in /ibatis/trunk/cs: V1/src/IBatisNet.Common/Utilities/TypesResolver/TypeResolver.cs V1/src/IBatisNet.DataMapper.Test/bin/Debug/IBatisNet.DataMapper.Test.dll.config V3/src/Apache

2008-06-05 Thread gbayon
Author: gbayon
Date: Thu Jun  5 13:40:05 2008
New Revision: 663728

URL: http://svn.apache.org/viewvc?rev=663728view=rev
Log:
fix IBATISNET-270

Modified:

ibatis/trunk/cs/V1/src/IBatisNet.Common/Utilities/TypesResolver/TypeResolver.cs

ibatis/trunk/cs/V1/src/IBatisNet.DataMapper.Test/bin/Debug/IBatisNet.DataMapper.Test.dll.config

ibatis/trunk/cs/V3/src/Apache.Ibatis.Common/Utilities/TypesResolver/TypeResolver.cs

Modified: 
ibatis/trunk/cs/V1/src/IBatisNet.Common/Utilities/TypesResolver/TypeResolver.cs
URL: 
http://svn.apache.org/viewvc/ibatis/trunk/cs/V1/src/IBatisNet.Common/Utilities/TypesResolver/TypeResolver.cs?rev=663728r1=663727r2=663728view=diff
==
--- 
ibatis/trunk/cs/V1/src/IBatisNet.Common/Utilities/TypesResolver/TypeResolver.cs 
(original)
+++ 
ibatis/trunk/cs/V1/src/IBatisNet.Common/Utilities/TypesResolver/TypeResolver.cs 
Thu Jun  5 13:40:05 2008
@@ -313,10 +313,10 @@
 
 #region Fields
 
-private string _unresolvedGenericTypeName = string.Empty;
-private string[] _unresolvedGenericArguments = null;
-
-#endregion
+private string _unresolvedGenericTypeName = string.Empty;
+private string[] _unresolvedGenericArguments = null;
+private readonly static Regex generic = new Regex(@`\d*\[\[, 
RegexOptions.Compiled); 
+#endregion
 
 #region Constructor (s) / Destructor
 
@@ -411,11 +411,8 @@
 
 private void ParseGenericArguments(string originalString)
 {
-RegexOptions options = RegexOptions.None;
-Regex regex = new Regex(@.*`\d*\[\[, options);
 // Check for match
-bool isMatch = regex.IsMatch(originalString);
-
+bool isMatch = generic.IsMatch(originalString); 
 if (!isMatch)
 {
 _unresolvedGenericTypeName = originalString;

Modified: 
ibatis/trunk/cs/V1/src/IBatisNet.DataMapper.Test/bin/Debug/IBatisNet.DataMapper.Test.dll.config
URL: 
http://svn.apache.org/viewvc/ibatis/trunk/cs/V1/src/IBatisNet.DataMapper.Test/bin/Debug/IBatisNet.DataMapper.Test.dll.config?rev=663728r1=663727r2=663728view=diff
==
--- 
ibatis/trunk/cs/V1/src/IBatisNet.DataMapper.Test/bin/Debug/IBatisNet.DataMapper.Test.dll.config
 (original)
+++ 
ibatis/trunk/cs/V1/src/IBatisNet.DataMapper.Test/bin/Debug/IBatisNet.DataMapper.Test.dll.config
 Thu Jun  5 13:40:05 2008
@@ -31,21 +31,21 @@
iBATIS
logging
 
-   logFactoryAdapter 
type=IBatisNet.Common.Logging.Impl.ConsoleOutLoggerFA, IBatisNet.Common
+!--   logFactoryAdapter 
type=IBatisNet.Common.Logging.Impl.ConsoleOutLoggerFA, IBatisNet.Common
arg key=showLogName value=true /
arg key=showDataTime value=true /
arg key=level value=ALL /
arg key=dateTimeFormat value=/MM/dd 
HH:mm:ss:SSS /
/logFactoryAdapter
-   
+--   
  !--  logFactoryAdapter 
type=IBatisNet.Common.Logging.Impl.Log4NetLoggerFA, 
IBatisNet.Common.Logging.Log4Net
 arg key=configType value=inline /
   /logFactoryAdapter 
 --
 
-!--  
+
  logFactoryAdapter type=IBatisNet.Common.Logging.Impl.NoOpLoggerFA, 
IBatisNet.Common /
---
+
   
/logging
/iBATIS

Modified: 
ibatis/trunk/cs/V3/src/Apache.Ibatis.Common/Utilities/TypesResolver/TypeResolver.cs
URL: 
http://svn.apache.org/viewvc/ibatis/trunk/cs/V3/src/Apache.Ibatis.Common/Utilities/TypesResolver/TypeResolver.cs?rev=663728r1=663727r2=663728view=diff
==
--- 
ibatis/trunk/cs/V3/src/Apache.Ibatis.Common/Utilities/TypesResolver/TypeResolver.cs
 (original)
+++ 
ibatis/trunk/cs/V3/src/Apache.Ibatis.Common/Utilities/TypesResolver/TypeResolver.cs
 Thu Jun  5 13:40:05 2008
@@ -284,10 +284,12 @@
 
 #region Fields
 
-private string _unresolvedGenericTypeName = string.Empty;
-private string[] _unresolvedGenericArguments = null;
+private string _unresolvedGenericTypeName = string.Empty;
+private string[] _unresolvedGenericArguments = null;
 
-#endregion
+private readonly static Regex generic = new Regex(@`\d*\[\[, 
RegexOptions.Compiled); 
+
+#endregion
 
 #region Constructor (s) / Destructor
 
@@ -382,10 +384,7 @@
 
 private void ParseGenericArguments(string originalString)
 {
-RegexOptions options = RegexOptions.None;
-Regex regex = new Regex(@.*`\d*\[\[, options);
-// Check for match
-bool isMatch = 

svn commit: r663760 - in /ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator: api/ config/ config/xml/ internal/ internal/db/ internal/java/model/ internal/sqlmap/ internal/types/ intern

2008-06-05 Thread jgbutler
Author: jgbutler
Date: Thu Jun  5 15:05:48 2008
New Revision: 663760

URL: http://svn.apache.org/viewvc?rev=663760view=rev
Log:
ibator: minor refactoring

Modified:

ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/api/FullyQualifiedTable.java

ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/config/IbatorContext.java

ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/config/TableConfiguration.java

ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/config/xml/IbatorConfigurationParser.java

ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/internal/DefaultCommentGenerator.java

ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/internal/db/DatabaseIntrospector.java

ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/internal/db/IntrospectedTableDefaultImpl.java

ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/internal/java/model/JavaModelGeneratorJava2Impl.java

ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/internal/sqlmap/SqlMapGeneratorIterateImpl.java

ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/internal/types/JavaTypeResolverDefaultImpl.java

ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/internal/util/StringUtility.java

ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/internal/util/messages/messages.properties

Modified: 
ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/api/FullyQualifiedTable.java
URL: 
http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/api/FullyQualifiedTable.java?rev=663760r1=663759r2=663760view=diff
==
--- 
ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/api/FullyQualifiedTable.java
 (original)
+++ 
ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/api/FullyQualifiedTable.java
 Thu Jun  5 15:05:48 2008
@@ -288,7 +288,6 @@
 }
 
 // TODO - strip characters that are not valid in package names
-
 return sb.toString();
 }
 

Modified: 
ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/config/IbatorContext.java
URL: 
http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/config/IbatorContext.java?rev=663760r1=663759r2=663760view=diff
==
--- 
ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/config/IbatorContext.java
 (original)
+++ 
ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/config/IbatorContext.java
 Thu Jun  5 15:05:48 2008
@@ -465,7 +465,7 @@
 super.addProperty(name, value);
 
 if (PropertyRegistry.CONTEXT_SUPPRESS_TYPE_WARNINGS.equals(name)) {
-suppressTypeWarnings = true.equalsIgnoreCase(value); 
//$NON-NLS-1$
+suppressTypeWarnings = StringUtility.isTrue(value);
 } else if (PropertyRegistry.CONTEXT_BEGINNING_DELIMITER.equals(name)) {
 beginningDelimiter = value;
 } else if (PropertyRegistry.CONTEXT_ENDING_DELIMITER.equals(name)) {

Modified: 
ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/config/TableConfiguration.java
URL: 
http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/config/TableConfiguration.java?rev=663760r1=663759r2=663760view=diff
==
--- 
ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/config/TableConfiguration.java
 (original)
+++ 
ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/config/TableConfiguration.java
 Thu Jun  5 15:05:48 2008
@@ -481,7 +481,7 @@
 }
 }
 
-if 
(true.equalsIgnoreCase(getProperty(PropertyRegistry.TABLE_USE_COLUMN_INDEXES)))
 {  //$NON-NLS-1$
+if 
(StringUtility.isTrue(getProperty(PropertyRegistry.TABLE_USE_COLUMN_INDEXES))) {
 // when using column indexes, either both or neither query ids 
should be set
 if (selectByExampleStatementEnabled  
selectByPrimaryKeyStatementEnabled) {
 boolean queryId1Set = 
StringUtility.stringHasValue(selectByExampleQueryId);

Modified: 
ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/config/xml/IbatorConfigurationParser.java
URL: 
http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/config/xml/IbatorConfigurationParser.java?rev=663760r1=663759r2=663760view=diff
==
--- 
ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/config/xml/IbatorConfigurationParser.java
 (original)
+++