More thoughts as I am digging further...

On Tue, Aug 12, 2008 at 1:52 PM, Niclas Hedhman <[EMAIL PROTECTED]> wrote:

> public interface AbcMapping extends Abc
> {
>    @QueryMethod
>    Habba findHabbaFromName( @VariableName( "name" ) String name );
> }

In the above example, the pojo itself will be returned, but as I
mentioned briefly, I would like to achieve automatic mapping into a
Qi4j result type instead, so I can have a "QiHabba" composite being
the query result type, although a PojoHabba is returned in the web
service.

One possibility would be to map that in with the mapping interface;

public interface AbcMapping extends Abc
{
    @QueryMethod
    @QueryResult( QiHabba.class )
    Habba findHabbaFromName( @VariableName( "name" ) String name );
}

which is very explicit.

OR, I think one could figure it out via the resultType in the
newNamedQuery( String name, Class resultType, UnitOfWork uow ).


Nevertheless;
Another problem. CompositeBuilder supports a use()/@Uses construct,
which EntityBuilder doesn't and to get the same effect I would need to
create the EntityStore variant of the whole thing. So, the "simple"
version is not really implementable, since the Mixin that does it all
have no visibility into the domain model, i.e. it can't instantiate a
QiHabba.

I am therefor scrapping the implementation so far, and redoing via an
EntityStore and see what shows up. But the interface mapping concept
above is something that I kind of like.


Cheers
Niclas

_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev

Reply via email to