Skip to content

Commit

Permalink
内部表结构优化。
Browse files Browse the repository at this point in the history
  • Loading branch information
cyq1162 committed May 19, 2019
1 parent baf5028 commit 86a6b97
Show file tree
Hide file tree
Showing 7 changed files with 318 additions and 293 deletions.
8 changes: 4 additions & 4 deletions DAL/Conn/ConnBean.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ private ConnBean()
/// <summary>
/// 数据库类型
/// </summary>
public DataBaseType ConnDalType;
public DataBaseType ConnDataBaseType;
/// <summary>
/// 数据库版本信息
/// </summary>
Expand All @@ -54,7 +54,7 @@ public ConnBean Clone()
ConnBean cb = new ConnBean();
cb.ConnName = this.ConnName;
cb.ConnString = this.ConnString;
cb.ConnDalType = this.ConnDalType;
cb.ConnDataBaseType = this.ConnDataBaseType;
cb.IsOK = this.IsOK;
return cb;
}
Expand Down Expand Up @@ -150,8 +150,8 @@ public static ConnBean Create(string connNameOrString)
}
ConnBean cb = new ConnBean();
cb.ConnName = connNameOrString;
cb.ConnDalType = GetDataBaseType(connString);
cb.ConnString = RemoveConnProvider(cb.ConnDalType, connString);
cb.ConnDataBaseType = GetDataBaseType(connString);
cb.ConnString = RemoveConnProvider(cb.ConnDataBaseType, connString);
connBeanDicCache.Add(hash, cb);
hash = cb.ConnString.GetHashCode();
if (!connBeanDicCache.ContainsKey(hash))
Expand Down
2 changes: 1 addition & 1 deletion DAL/Conn/ConnObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ internal static ConnObject Create(string connNameOrString)
if (connNameOrString != null && connNameOrString.Length < 32 && !connNameOrString.Trim().Contains(" ")) // 为configKey
{
ConnBean coBak = ConnBean.Create(connNameOrString + "_Bak");
if (coBak != null && coBak.ConnDalType == cbMaster.ConnDalType)
if (coBak != null && coBak.ConnDataBaseType == cbMaster.ConnDataBaseType)
{
co.BackUp = coBak;
co.BackUp.IsBackup = true;
Expand Down
4 changes: 2 additions & 2 deletions DAL/DalBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public DataBaseType DataBaseType
{
get
{
return ConnObj.Master.ConnDalType;
return ConnObj.Master.ConnDataBaseType;
}
}
#endregion
Expand Down Expand Up @@ -1243,7 +1243,7 @@ internal bool OpenCon(ConnBean cb, AllowConnLevel leve)
}
else
{
WriteError(UsingConnBean.ConnDalType + ".OpenCon():" + UsingConnBean.ErrorMsg);
WriteError(UsingConnBean.ConnDataBaseType + ".OpenCon():" + UsingConnBean.ErrorMsg);
}
if (IsRecordDebugInfo)
{
Expand Down
2 changes: 1 addition & 1 deletion DAL/DalCreate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ private static DalBase CreateDalBase(string connNameOrString)
}
private static DalBase GetDalBaseBy(ConnObject co)
{
DataBaseType dalType = co.Master.ConnDalType;
DataBaseType dalType = co.Master.ConnDataBaseType;
//License.Check(providerName);//框架模块授权检测。
switch (dalType)
{
Expand Down
4 changes: 2 additions & 2 deletions Orm/SimpleOrmBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -233,9 +233,9 @@ private void SetDelayInit(Object entityInstance, string tableName, string conn)
{
Error.Throw(errMsg);
}
Columns = TableSchema.GetColumnByType(typeInfo);
Columns = TableSchema.GetColumnByType(typeInfo, conn);
ConnBean connBean = ConnBean.Create(conn);//下面指定链接,才不会在主从备时被切换到其它库。
if (!DBTool.Exists(tableName, connBean.ConnString))
if (!DBTool.Exists(tableName, "U", connBean.ConnString))
{
DBTool.ErrorMsg = null;
if (!DBTool.CreateTable(tableName, Columns, connBean.ConnString))
Expand Down
Loading

0 comments on commit 86a6b97

Please sign in to comment.