Roo - add custom finder

做~自己de王妃 提交于 2019-12-21 05:14:12

问题


I used Roo to create a project that uses existing database. Im able to create dynamic finders, but I want to implement custom finder that will receive 4 parameters and use some of them to create Like condition and others for equals condition.

What is the best way to do this with Roo.


回答1:


The recommended pattern is to edit the .java source file for your entity and define the new finder there. You might like to create a dynamic finder and then copy the style from the corresponding entityname_Roo_Finder.aj file. Please note manually-created finders do not appear in the automatically-created web scaffold (whereas dynamic finders will).




回答2:


You'll probably have to copy the entityManager()-Getter as in:

new DomainClass().entityManager;


来源:https://stackoverflow.com/questions/2075368/roo-add-custom-finder

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!