static SqlTemplate() { Select = new SelectTemplate(); Update = new UpdateTemplate(); Delete = new DeleteTemplate(); Insert = new InsertTemplate(); Repeate = new RepeateTemplate(); Count = new CountTemplate(); }
public override void StaticSqlStringCache(SqlModel model, Type type) { GsOperator gs = new GsOperator(typeof(SqlEntity <>), type); gs["SetPrimary"] = MebOperator.Setter(type, model.PrimaryKey); gs["Table"] = model.TableName; gs["Primary"] = model.PrimaryKey; CountTemplate count = new CountTemplate(); gs["SelectCount"] = count.SelectCount(model); gs["SelectCountWhere"] = count.SelectCountWhere(model); SelectTemplate select = new SelectTemplate(); gs["SelectAll"] = select.SelectAll(model); gs["SelectAllWhere"] = select.SelectAllWhere(model); gs["SelectAllByPrimary"] = select.SelectAllByPrimary(model); gs["SelectAllIn"] = select.SelectAllIn(model); UpdateTemplate update = new UpdateTemplate(); gs["UpdateAllWhere"] = update.UpdateWhere(model); gs["UpdateAllByPrimary"] = update.UpdateByPrimary(model); InsertTemplate insert = new InsertTemplate(); gs["InsertAll"] = insert.Insert(model); DeleteTemplate delete = new DeleteTemplate(); gs["DeleteWhere"] = delete.DeleteWhere(model); gs["DeleteByPrimary"] = delete.DeleteByPrimary(model); RepeateTemplate repeate = new RepeateTemplate(); var repeateModel = model.ModelWithAttr <NoRepeateAttribute>(); gs["RepeateCount"] = repeate.RepeateCount(repeateModel); gs["RepeateId"] = repeate.RepeateId(repeateModel); gs["RepeateEntities"] = repeate.RepeateEntities(repeateModel); }