开发者

Roo - add custom finder

开发者 https://www.devze.com 2022-12-16 19:04 出处:网络
I used Roo to create a project that uses existing database. Im able to create dynamic finders, but I want to implement custom f开发者_开发问答inder that will receive 4 parameters and use some of them

I used Roo to create a project that uses existing database. Im able to create dynamic finders, but I want to implement custom f开发者_开发问答inder 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.


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).


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

new DomainClass().entityManager;
0

精彩评论

暂无评论...
验证码 换一张
取 消