/// <summary> /// Run the generator (*.bat or *.jar) /// </summary> /// <param name="TargetRuntime">targetRuntime. e.g : MyBatis3</param> /// <param name="ConnectionUrl">connectionUrl. e.g : jdbc:mysql://localhost:3306/wms?characterEncoding=utf-8</param> /// <param name="UserId">userId</param> /// <param name="Password">password</param> /// <param name="IsForceBigDecimals">isForceBigDecimals</param> /// <param name="IsEnableSubPackages">isEnableSubPackages</param> /// <param name="IsTrimStrings">isTrimStrings</param> /// <param name="ModelPackage">modelPackage</param> /// <param name="JavaMapperPackage">javaMapperPackage</param> /// <param name="XmlMapperPackage">xmlMapperPackage</param> public static void SerializeRun(string TargetRuntime, string ConnectionUrl, string UserId, string Password, string ModelPackage, string JavaMapperPackage, string XmlMapperPackage, bool IsForceBigDecimals, bool IsEnableSubPackages, bool IsTrimStrings) { ConfigFileBuilder fileBuilder = ConfigFileBuilder.getInstance(TargetRuntime, ConnectionUrl, UserId, Password, ModelPackage, JavaMapperPackage, XmlMapperPackage, IsForceBigDecimals, IsEnableSubPackages, IsTrimStrings); fileBuilder.GenerateMyBatisConfigXml(); }
/// <summary> /// Get ConfigFileBuilder singleton instance /// </summary> /// <param name="TargetRuntime">targetRuntime. e.g : MyBatis3</param> /// <param name="ConnectionUrl">connectionUrl. e.g : jdbc:mysql://localhost:3306/wms?characterEncoding=utf-8</param> /// <param name="UserId">userId</param> /// <param name="Password">password</param> /// <param name="IsForceBigDecimals">isForceBigDecimals</param> /// <param name="IsEnableSubPackages">isEnableSubPackages</param> /// <param name="IsTrimStrings">isTrimStrings</param> /// <param name="ModelPackage">modelPackage</param> /// <param name="JavaMapperPackage">javaMapperPackage</param> /// <param name="XmlMapperPackage">xmlMapperPackage</param> /// <returns>ConfigFileBuilder singleton instance</returns> public static ConfigFileBuilder getInstance(string TargetRuntime, string ConnectionUrl, string UserId, string Password, string ModelPackage, string JavaMapperPackage, string XmlMapperPackage, bool IsForceBigDecimals, bool IsEnableSubPackages, bool IsTrimStrings) { if (instance == null) { instance = new ConfigFileBuilder(); ConfigFileBuilder.TargetRuntime = TargetRuntime; ConfigFileBuilder.ConnectionUrl = ConnectionUrl; ConfigFileBuilder.UserId = UserId; ConfigFileBuilder.Password = Password; ConfigFileBuilder.IsForceBigDecimals = IsForceBigDecimals; ConfigFileBuilder.IsEnableSubPackages = IsEnableSubPackages; ConfigFileBuilder.IsTrimStrings = IsTrimStrings; ConfigFileBuilder.ModelPackage = ModelPackage; ConfigFileBuilder.JavaMapperPackage = JavaMapperPackage; ConfigFileBuilder.XmlMapperPackage = XmlMapperPackage; } return(instance); }