问题描述
我目前正在使用JPA实体进行大量测试,我必须在实体上继续调用setter方法,如下所示:
myEntity.setXXX(值);
myEntity.setYYY(value);
myEntity.setZZZ(value);
eclipse IDE中是否有任何魔术快捷方式或菜单来生成所有启动的setter-method-call与set一样,像在ctrl-space(自动完成)弹出窗口中显示的那样(我认为Object中继承的方法没有在弹出窗口中显示)?
我想象一下:
- 我键入myEntity.set
- 和myEntity.set *只要一个懒惰的程序员,目前正在使用Eclipse Helios IDE。
$ b>谢谢!
编辑
我不在source - > generate getter和setter,因为这将有助于我自己生成方法。生成
方法调用
是我想要实现的。解决方案找到答案(我一直在寻找这个东西)...
最简单的方法是在包资源管理器中扩展类成员,将它们排序名称,多选择所有的设置者,然后你在剪贴板中有所有的方法名称...
; - )
Im currently doing a lot of testing with JPA entities, where i have to keep calling the setter methods on the entity that looks something like this :
myEntity.setXXX(value); myEntity.setYYY(value); myEntity.setZZZ(value);
Is there any magic shortcut or menu in eclipse IDE to generate all the setter-method-calls that starts with "set", like those displayed in the ctrl-space (auto completion) popup (i think the inherited methods from Object are not being shown at popup) ?
So im imagining something like :
- i type myEntity.set
- and myEntity.set* are generated right away
Im a lazy programmer and currently using Eclipse Helios IDE.
Thank you !
Edit
Im not looking for source -> generate getter and setter, because that would helps me in generating the methods itself. Generating the
method calls
is what i want to achieve.解决方案I have found the answer (I was always searching for this thing)...
The easiest way is to expand the class members in the "Package Explorer", sort them by name, multi-select all the setters, and then you have in the clipboard all the method names...
;-)
这篇关于在Eclipse中生成POJO的所有setXXX调用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!