-
Dec 12th, 2011, 11:53 AM
#1
creating new method in the spring roo controller
Hi,
I am very new to spring roo.
Here is the scenario that i am looking for.
I have created a spring controller with few operations. i need to add new operation(method).
How can i add new operation in the existing controller?
Regards,
Sudhakar
-
Dec 12th, 2011, 12:14 PM
#2
Generally, you add a new method as with the same principles you add any method in a Spring MVC application or a java application. If you're not overriding some other method, just write the method and call it from where you need it. Spring Roo will not manage your method, however. Roo only manages code in the Aspect J ITD files (those ending with .aj).
If you need to reimplement one of the methods that Roo have generated and manages in the ITDs you pushin this method (details are in the manual) and change it as you want it.
-
Dec 14th, 2011, 12:21 PM
#3
Thanks MiB.
**_Roo_Entity.aj has method called **.persist() which persist one object at a time to DB.
I want to add batch insert capability in the **_Roo_Entity.aj.
A method which takes list of object and does bulk insert. like creatAll(List<**> objects).
is it possible to do by adding new method in **._Roo_Entity.aj?
-
Dec 14th, 2011, 02:34 PM
#4
Have you tried making a field with "List<**>"?
-
Dec 14th, 2011, 06:11 PM
#5
it does not allow List<**>, but i was able to generate Set<**> field.
but just field with the @ManyToMany annotation on it.
it does not create any method in **_Roo_Entity.aj file.
-
Dec 14th, 2011, 06:23 PM
#6
It's bewildering that you are discussing the same thing in several threads so I'm stopping here now.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules