Open sakaman opened 1 year ago
Example build error SQL when Sqls parameter is empty, due to criterion may be empty sometimes.
mapper.selectByExample( Example.builder(Foo.class) .where(Sqls.custom()) .orderByDesc(Foo.CODE) .build() )
Generated the below incorrect SQL:
SELECT * FROM foo AND ORDER BY code Desc;
Determine whether sqls.getCriteria().getCriterions is empty or not when using the where related method in tk.mybatis.mapper.entity.Example.Builder#where(tk.mybatis.mapper.util.Sqls)
sqls.getCriteria().getCriterions
where
tk.mybatis.mapper.entity.Example.Builder#where(tk.mybatis.mapper.util.Sqls)
Problem
Example build error SQL when Sqls parameter is empty, due to criterion may be empty sometimes.
Example
Generated the below incorrect SQL:
Possible Solution
Determine whether
sqls.getCriteria().getCriterions
is empty or not when using thewhere
related method intk.mybatis.mapper.entity.Example.Builder#where(tk.mybatis.mapper.util.Sqls)