Announcement Announcement Module
No announcement yet.
How to inject a non-entity to a Domain Object Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to inject a non-entity to a Domain Object

    Not sure if this is a roo issue or me misunderstanding JPA Entities. Shouldn't I be able to have a reference to a non-entity in my Entity? I have a RooEntity with the following structure:

    public class Money{

    private MoneyService moneyService;

    ... other private fields that map to the db

    I get "Could not scaffold controller for type Money, the referenced type MoneyService cannot be handled" and roo stops managing the file.

    Am I doing something wrong?


  • #2
    I'll bump this once then go away.

    Am I not allowed to reference any other Objects besides another RooEntity from within a RooEntity or scaffolding breaks? I've tried all kinds of Foo permutations, but unless Foo is a RooEntity I get the cannot handle referenced type error. I thought the @Transient annotation would get Roo to ignore it. Is there anything I can put on the field to get Roo to continue to manage the file? I wanted to give the "rich domain object" approach a try, for example Product.purchase(), but it needs to be able to hold references to service-type objects that aren't just other beans.