Skip to content
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

可以提供查询对象结果和对象实体对应的工具方法嘛 #266

Closed
xupengjun opened this issue Mar 4, 2021 · 7 comments
Closed
Assignees

Comments

@xupengjun
Copy link

现在查询出来的结果还需要自己手动对应到实体中,太过麻烦

@laura-ding
Copy link
Contributor

现在查询出来的结果还需要自己手动对应到实体中,太过麻烦

没明白你的意思,什么叫做手动对应到实体,你可以举例说明吗?查询结果的类型肯定是要用户自己去判断,然后拿相应的类型,然后每种类型是已经有相应的包装的。

@xupengjun
Copy link
Author

xupengjun commented Mar 22, 2021 via email

@laura-ding
Copy link
Contributor

@xupengjun
Copy link
Author

xupengjun commented Mar 22, 2021 via email

@laura-ding
Copy link
Contributor

麻烦你说下怎么个繁琐法可以吗?

@xupengjun
Copy link
Author

xupengjun commented Mar 22, 2021 via email

@laura-ding
Copy link
Contributor

现在使用,我们需要自己写一个工具类,来映射查询出的结果,和自己定义的实体对象赋值,mybatis这种不就是写sql语句,然后自己将查询出的结果,自动根据属性对应到返回类的属性上嘛。或者hibernate那种,mybatisplus这样的也挺好用的啊。说明了,目前就相当于一个jdbc操作,拿到每个ResultSet result = session.execute("FETCH PROP ON person 'Bob';");然后在挨个手动遍历封装返回对象。

------------------ 原始邮件 ------------------ 发件人: "vesoft-inc/nebula-java" @.>; 发送时间: 2021年3月22日(星期一) 下午3:53 @.>; @.@.>; 主题: Re: [vesoft-inc/nebula-java] 可以提供查询对象结果和对象实体对应的工具方法嘛 (#266) 麻烦你说下怎么个繁琐法可以吗? — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

我们会先提供一个用 python 实现的工具库,假如用户反响好,再给 java 也增加一个。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants