Results 1 to 2 of 2

Thread: How to inject a non-entity to a Domain Object

  1. #1
    Join Date
    Dec 2010
    Posts
    14

    Default 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:

    @RooJavaBean
    @RooEntity
    public class Money{

    @Autowired
    @Transient
    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?

    tia

  2. #2
    Join Date
    Dec 2010
    Posts
    14

    Default

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •