修改生成的roo控制器的show方法
我正在学习 Roo,并且有一个包含学生对象的数据库,该学生对象具有关联的分数对象。我想在学生控制器上执行 show 方法时显示分数对象。 StudentController.java 文件不包含任何代码,我是否正确地假设我需要修改关联的 .aj 文件?如果是这样,我如何告诉 Roo 不要覆盖我所做的任何更改?
I am learning Roo and have a database with a student object that has associated score objects. I would like to display the score objects when the show method is executed on the student controler. The StudentController.java file contains no code, am I correct in assuming I need to modify the associated .aj file? If so how do I tell Roo to not overwrite any changes I make?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您应该将代码放入 StudentController.java。 .aj 文件由 Roo 管理,.java 文件由您决定,不会被 Roo 覆盖。
You should put your code to the StudentController.java. The .aj files are managed by Roo, .java files are left up to you and will not be overwritten by Roo.
您可以将 .aj 文件中的现有代码推送到 .java 文件中,然后您可以在那里修改它。在 eclipse 中,您可以使用aspectj 重构菜单。
You can push-in the existing code in the .aj files into your .java files, then you can modify it there. In eclipse, your can use the aspectj refactoring menu.