OK, what is problem with this? Everything should work fine except
return parameter of service method which always return 'Type' and you
have to cast it to right type. Just do in your service declarations:
@Type remove(@Type t);
Collection<@Type> findAll();

Casting return value isn't big issue, I hope. If yes, than write your
own facade which can use generics and is using generated service at
background. This your service implementation should be put to
'more.xml' with nice name like 'TypeService' and rename your generated
service in model file to 'MyTypeHiddenService' and inject it in
more.xml into your own service.

If you really want to push Sculptor to generate generics, it's huge
amount of work because you have to change everything from syntax
definition to generation templates. However you are always welcome on
board.

Hope this help

Pavel

On Mon, Jul 27, 2009 at 12:05 PM, Sascha Broich -
TSA<sascha.bro...@tsa.de> wrote:
>> Von: Pavel Tavoda [mailto:pavel.tav...@gmail.com]
>>
>> >From you explanation it looks like clear inheritance. Make BaseType
>> and than inherit all Types from it. Implementation should be placed
>> only to BaseType.
>
> This is, what I have done so far. I'm fine with the entity declaration.
>
> My problem occurs when it comes to the service.
> I'd like to specify like this:
>
>
> abstract Entity Type
> {
>  scaffold
>
>  String shortKey key;
>  String description;
>
>  Repository TypeRepository
>  {
>  }
> }
>
> Entity TypeA extends @Type
> {
> }
>
> Entity TypeB extends @Type
> {
> }
>
> Service TypeService
> {
>  >@TypeRepository
>
>  <T extends Type> T add(T t);
>  <T extends Type> T save(T t);
>  <T extends Type> T remove(T t);
>  <T extends Type> Collection<T> findAll(Class<T> clazz);
>  <T extends Type> T findByKey(Class<T> clazz, String key);
> }
>
> So that I can call the service:
>
> - typeService.findAll(TypeB.class);
> - typeService.findByKey(TypeA.class, "ABC");
>
>
> Regards,
> Sascha Broich
>
> --
> TSA - Teleport Sachsen-Anhalt Service GmbH
> Delitzscher Straße 70, 06112 Halle
> Phone: +49 39203 8 2524
> Email: 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
>

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

Reply via email to