http://forum.springsource.org/showthread.php?t=104652
On 2 мар, 15:26, Zed <zed...@gmail.com> wrote: > As far as I see no one is going to answer me. > I foundhttps://jira.springsource.org/browse/ROO-1595and if I got > them right there is NO custom finder methods available at this time > (it's still openned). > Without them I can't use generated Request object and possibly all > over stuff. > If you don't want to explain just say am I right or not. If I can't > use custom finder methods I just leave roo and do everything by hands. > > On 1 мар, 12:50, Zed <zed...@gmail.com> wrote: > > > > > > > > > At the moment I moved forward. In ROO-931 its says us "At the moment > > the gwt setup command generates request objects for all finder > > methods" (from > > herehttps://jira.springsource.org/browse/ROO-931?page=com.atlassian.jira....). > > I added 'finder' using Roo shell command: finder add > > findEmployeesByDepartmentEquals > > After that Roo generated me an Aspect: > > > privileged aspect Employee_Roo_Finder { > > > public static Query > > Employee.findEmployeesByDepartmentEquals(String department) { > > if (department == null || department.length() == 0) throw new > > IllegalArgumentException("The department argument is required"); > > EntityManager em = Employee.entityManager(); > > Query q = em.createQuery("SELECT Employee FROM Employee AS > > employee WHERE employee.department = :department"); > > q.setParameter("department", department); > > return q; > > } > > > and added anotation to Employee.java: @RooEntity(finders = > > {"findEmployeesByDepartmentEquals"}) > > but no request objects generated. My EmployeeRequest.java (generated > > and maintained by Roo) looks as follows (I can't see finder methods > > there): > > > @RooGwtMirroredFrom("org.springsource.roo.extrackgae.server.domain.Employee > > ") > > @ServiceName("org.springsource.roo.extrackgae.server.domain.Employee") > > public interface EmployeeRequest extends RequestContext { > > > abstract Request<java.lang.Long> countEmployees(); > > > abstract > > Request<java.util.List<org.springsource.roo.extrackgae.client.managed.reque > > st.EmployeeProxy>> > > findAllEmployees(); > > > abstract > > Request<java.util.List<org.springsource.roo.extrackgae.client.managed.reque > > st.EmployeeProxy>> > > findEmployeeEntries(int firstResult, int maxResults); > > > abstract > > Request<org.springsource.roo.extrackgae.client.managed.request.EmployeeProx > > y> > > findEmployee(Long id); > > > abstract > > InstanceRequest<org.springsource.roo.extrackgae.client.managed.request.Empl > > oyeeProxy, > > java.lang.Void> remove(); > > > abstract > > InstanceRequest<org.springsource.roo.extrackgae.client.managed.request.Empl > > oyeeProxy, > > java.lang.Void> persist(); > > > } > > > Tell me please where I'm wrong? How to make finder methods works? > > > On 25 фев, 17:00, Zed <zed...@gmail.com> wrote: > > > > Hellow everyone, I started to deal with GWT+roo scaffolding ap and > > > found the idea very cool. Thank you guys! > > > But I found it hard for me to understanf how to implement custom > > > "find" methods like for example - findAllEmployeesByName. > > > I looked all the documentations and it's written there that I can add > > > this method to Entity object itself like this: > > > > @RooJavaBean > > > @RooToString > > > @RooEntity > > > public class Employee { > > > > ..... > > > > @NotNull > > > private String displayName; > > > > @SuppressWarnings("unchecked") > > > public static List<Employee> findAllEmployeesByName(String name){ > > > return entityManager().createQuery("select ....... from Employee > > > o").getResultList(); > > > }} > > > > I added it but nothing happend. No code generation started. > > > I see all finder methods are in Aspects which are generated by Roo > > > itself and I can't put my code there. > > > Can you guys give me some hint please. > > > > With respect > > > Andrew Efremov -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.