polygene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Niclas Hedhman <nic...@hedhman.org>
Subject Re: toValueList, toValueMap, toValueSet
Date Sat, 03 Sep 2016 12:24:50 GMT
This has now been committed to develop.

The difference in client code is approx something like his;

UnitOfWork uow = uowf.currentUnitOfWork();
Vets vets = uow.get( Vets.class, "<all vets>" );
return vets
    .vets()
    .toList()
    .stream()
    .map( entity -> uow.toValue( Vet.class, entity ))
    .collect( Collectors.toList() );


compared to

UnitOfWork uow = uowf.currentUnitOfWork();
Vets vets = uow.get( Vets.class, "<all vets>" );
return uow.toValueList( vets.vets() );


which I think is enough clutter improvement to validate the addition.

If people have good ideas on making this even better, I am all ears.


On Sat, Sep 3, 2016 at 8:42 AM, Niclas Hedhman <niclas@hedhman.org> wrote:

>
> Thanks for volunteering, but I implemented this faster than I could create
> the Jira for it... and I have not committed it because of the missing Jira.
> I'll do the Jira now, and commit the code. I will also add another Jira for
> the opposite direction, which I will leave for you to implement.
>
> Niclas
>
> On Fri, Sep 2, 2016 at 11:26 PM, Prince Arora <aroraprince151@gmail.com>
> wrote:
>
>> Hi Niclas,
>>
>> I will do it. Please let me know below it the requirement what we need
>> right?
>> We need a function in UnitOfWork to perform this to get Named or Many
>> Association and  convert it to List/Map/Set/ValueCommposit
>>
>>
>> On Fri, Sep 2, 2016 at 6:58 PM, Niclas Hedhman <niclas@hedhman.org>
>> wrote:
>>
>> > Hi,
>> > I am working on a migration experiment, and a common pattern in that
>> > migration is to take a ManyAssocation or a NamedAssociation and convert
>> > that to a List/Set/Map or ValueComposites.
>> >
>> > I would like to add that feature into UnitOfWork.
>> >
>> > I suspect I want to do the other way around soon enough as well.
>> >
>> > WDYT?
>> >
>> > Cheers
>> > --
>> > Niclas Hedhman, Software Developer
>> > http://zest.apache.org - New Energy for Java
>> >
>>
>
>
>
> --
> Niclas Hedhman, Software Developer
> http://zest.apache.org - New Energy for Java
>



-- 
Niclas Hedhman, Software Developer
http://zest.apache.org - New Energy for Java

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message