New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
需求:增加新的Callback注入任意类型bean的对应属性 #541
Comments
|
用了 在 2013-10-30 16:08:17,"Thomas Yang" notifications@github.com 写道: A1A2 这两属性是否有用了@column注解? — |
如在 POJO 中用了 |
这种情况,你可以为你的A3 声明 @Readonly 属性 |
我的意思 可以增加一种新的解析方式,用于传入任意bean来获取值,而不需要声明任意属性,这对于自定义查询而不需要写自定义回调函数有很积极的意义。 |
参照 #456 这个pull request 来改代码自己实现吧。。。 |
@wxs123456 能说的再详细些吗? |
新版的Record支持带前缀的toEntity操作了 |
回调也是 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
应用场景:
A表有2两个字段,A1,A2,
映射后的实体类是也只有这两个属性,
现在我有个SQL语句
select A1,A2,(select count(*) from B where b.a1=a.a1) A3
FROM A;
为了得到计算列,我在实体类里添加属性A3,不加@column,,
通过
Sql sql = Sqls.create(sbsql.toString());
sql.setCallback(Sqls.callback.entities());
sql.setEntity(dao.getEntity(A.class));
dao.execute(sql);
List ls=sql.getList(A.class);
无法取到A3的值,
如果声明了@column,则可以取到。
The text was updated successfully, but these errors were encountered: