Announcement Announcement Module
Collapse
No announcement yet.
creating new method in the spring roo controller Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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

  • #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.

    Comment


    • #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?

      Comment


      • #4
        Have you tried making a field with "List<**>"?

        Comment


        • #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.

          Comment


          • #6
            It's bewildering that you are discussing the same thing in several threads so I'm stopping here now.

            Comment

            Working...
            X