That is true. Scaffold is mostly for prototyping or simple scenarios. 

If you need to inject the repository you need to define an empty repository.

        Service SomeService {
                inject @MyEntityRepository
                
                @MyEntity doSomething;
        }
        
        Entity MyEntity {
                scaffold
                String name
                
                Repository MyEntityRepository {
                }
        }

When delegating from service to repository you need to define at least the
operation you are delegating to.

        Service SomeService {
                saveMyEntity => @MyEntityRepository.save;
        }
        
        Entity MyEntity {
                scaffold
                String name
                
                Repository MyEntityRepository {
                        save;
                }
        }

And you can use scaffold but add your own additional operations.

        Service MyEntityService {
                doSomethingElse => @MyEntityRepository.somethingElse;
        }
    
        Entity MyEntity {
                scaffold
                String name
                
                Repository MyEntityRepository {
                        @MyEntity somethingElse(String foo);
                }
        }


I'm not sure if this helps. Please explain your scenario more if you need
further clarification.

/Patrik


Sascha Broich wrote:
> 
> Hello,
> 
> when I use scaffold for an entity I'm not able to use the entity's
> repository in a service written in the model. 
> There is always a workflow error "Couldn't resolve reference to
> EntityRepository" during validation.
> So the scaffold parameter is useless because I have to create the
> repository and its methods in my model anyway.
> 
> Is there a way to use the scaffold parameter and create a service in the
> model?
> 
> 
> Regards,
> Sascha Broich
> -- 
> TSA - Teleport Sachsen-Anhalt Service GmbH
> Delitzscher Straße 70, 06112 Halle
> Tel: +49 39203 8 2524 - Fax: 
> Mobil:   - E-Mail: sascha.bro...@tsa.de
> 
> Firmensitz: Steinfeldstraße 5, D-39179 Barleben
> Geschäftsführer: Marco Langhof
> Amtsgericht: Stendal HRB 6388
> http://www.tsa.de
> 
> 
> 
> 
> ------------------------------------------------------------------------------
> _______________________________________________
> Fornax-developer mailing list
> Fornax-developer@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/fornax-developer
> 
> 

-- 
View this message in context: 
http://www.nabble.com/scaffold-and-services-in-the-model-tp24643223s17564p24645615.html
Sent from the Fornax-Platform mailing list archive at Nabble.com.


------------------------------------------------------------------------------
_______________________________________________
Fornax-developer mailing list
Fornax-developer@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fornax-developer

Reply via email to