Announcement Announcement Module
No announcement yet.
using interfaces in roo Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • using interfaces in roo


    i have an interface "Person". Classes student and teacher implement Person..
    In roo shell,
    when i have a member in class College-- private Person p;
    it says Person has be have @Entity (but it is an interface) .. im going to inject a student to p in college from applicationContext
    1)it doesnt create a controller for College
    2) it does not seem to update *.aj files for student and teacher when i add "implements Person" ..
    3)how to represent value types (say using @Embedded)

    please show me a way out..
    Last edited by sowmya sree; Jun 11th, 2010, 05:35 PM.

  • #2
    why doesnt any1 reply !!!


    • #3
      I'm assuming that College is an entity. If you want a field injected by Spring, simply add the field in Java source and annotate it with @Autowired and @Transient. Roo entity relationship management is intended to be managed by JPA, not the Spring container.

      However, I assume that Student, Teacher and College and Person are entities. So I don't understand why you would want to inject an entity reference using Spring.

      Re (2), Roo will not automaticaly update .aj files when you make an entity implement an interface.


      • #4
        thank u for the reply

        Person is just an interface (its full of methods) so i dint know how to js use methods without members in in roo

        in my application, i dunno whether the person in class college is going to be a student or teacher.. so the container *.xml will contain whatever i want to inject (either student or teacher).. im going to use gwt soon for the UI.

        thanks once again