SmartSql v4.1.3 Release Notes
Release Date: 2019-07-26 // over 4 years ago-
Change Sample DB To SQLite And Fix SQLite ParameterPrefix ๐ 2. add support [For-tag] nest-value-access โก๏ธ 3. optimize Check null-Tag.Property from XML-tag โก๏ธ 4. optimize Check null-Tag.Property ExceptionMessage ๐ 5. add support Cache-Annotations for Repository-interface - Demo
[Cache("DateCache", "Lru", FlushInterval = 6000)] [Cache("LruCache", "Lru", FlushInterval = 6000)] [Cache("UserCache", "Fifo", FlushOnExecutes = new[] {"UpdateUserName"})] public interface IUsedCacheRepository { [ResultCache("DateCache", Key = "GetNow")] [Statement(Sql = "Select Now();")] DateTime GetNow(); [ResultCache("LruCache", Key = "GetId:$id")] [Statement(Sql = "Select @id;")] int GetId(long id); [ResultCache("UserCache", Key = "GetUserById:$id")] [Statement(Sql = "select * from T_User where id=@id;")] User GetUserById(long id); [Statement(Sql = "update T_User set UserName=@userName where id=@id;")] int UpdateUserName(long id, string userName); }
๐ 1. add support ColumnAttribute for EntityDeserializer ๐ 2. add support ColumnAttribute for RequestConvert ๐ 3. add support ParamAttribute for TypeHandler
add ResultType From ArrayType to Object for ExecuteScalar.
[Annotations.Table("t_annotation_entity")] public class ColumnAnnotationEntity { [Annotations.Column("id", IsAutoIncrement = true)] public long Id { get; set; } [Annotations.Column("name")] public String Name { get; set; } [Annotations.Column("extend_data", TypeHandler = "Json")] public ExtendData Data { get; set; } public class ExtendData { public String Info { get; set; } } }
public interface IColumnAnnotationRepository { ISqlMapper SqlMapper { get; } [Statement(Sql = "Select Top 1 T.\* From t\_column\_annotation\_entity T where T.id=@id")] ColumnAnnotationEntity GetEntity(long id); [Statement(Sql ="INSERT INTO t\_column\_annotation\_entity(name,extend\_data)VALUES(@Name,@Data);Select Scope\_Identity();")] int Insert(ColumnAnnotationEntity entity); [Statement(Sql ="INSERT INTO t\_column\_annotation\_entity(name,extend\_data)VALUES(@Name,@Data);Select Scope\_Identity();")] int Insert([Param("Name")] string name, [Param("Data", TypeHandler = "Json")] ColumnAnnotationEntity.ExtendData data); }