Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Per-Åke Minborg
    @minborg
    Interesting indeed
    Mark Schrijver
    @ractoc
    lombock removes almost alle constructors, getters, setters and builders
    mapstruct takes care of all bean mappers
    all you need to do is make sure the getters and setters in both beans are the same, and mapstruct does the rest
    Per-Åke Minborg
    @minborg
    Very interesting with MapStruct !
    Mark Schrijver
    @ractoc
    yeah, I hate boilerplate so anything I can do to get rid of that... Which is one of the main reasons I switched to speedment
    all the boilerplate is generated
    Per-Åke Minborg
    @minborg
    MapStruct could provide a bridge between Speedment and many other frameworks.
    Mark Schrijver
    @ractoc
    Yeah
    I use it to bridge between my Sring boot rest interface Model objects and my speedment generted db objects
    works like a charm, all I need to do is: ItemMapper.INSTANCE.modelToDb(item)
    Per-Åke Minborg
    @minborg
    Cool. I think it would make sense to write an article about it
    or someTable.stream().map(ItemMapper.INSTANCE::mopdelToDb)….
    Mark Schrijver
    @ractoc
    public List<ItemModel> getItemList() {
    return itemService.getItemList().map(ItemMapper.INSTANCE::dbToModel).collect(Collectors.toList());
    }
    this is my method for retreiving the full list of items
    Per-Åke Minborg
    @minborg
    :-)
    Mark Schrijver
    @ractoc
    and all I did was write a simple interface
    Per-Åke Minborg
    @minborg
    Really great.
    Mark Schrijver
    @ractoc

    @Mapper
    public interface ItemMapper {
    ItemMapper INSTANCE = Mappers.getMapper(ItemMapper.class);

    ItemImpl modelToDb(ItemModel model);
    
    ItemModel dbToModel(Item item);
    
    @SuppressWarnings("OptionalUsedAsFieldOrParameterType")
    default <T> T unwrapOptional(Optional<T> optional) {
        return optional.orElse(null);
    }

    }

    I'll see if I can write something over the next few days
    Per-Åke Minborg
    @minborg
    That would really be awesome!
    I could push the article through my channels
    Mark Schrijver
    @ractoc
    that would be great
    Mark Schrijver
    @ractoc
    now to find some inspiration...
    Mark Schrijver
    @ractoc
    first things first though, fixing my current wordpress install so I can actually put up the new tutorial
    lucky for my I didn't have that much content in there yet...
    although I will need to either fix all the code samples in one, or just drop that one completely
    Mark Schrijver
    @ractoc
    ok, done for now
    first setup is there. I will put the Speedment, Spring boot, Lombock, MapStruct tutorial series in there as well
    see if I can get something like an actual tutorial blog going there...
    Per-Åke Minborg
    @minborg
    sounds promising
    Mark Schrijver
    @ractoc
    should be able to start on my speedment tutorial series tonight
    just published the latest part in the unit test tutorial series
    Per-Åke Minborg
    @minborg
    :-0 Nice!
    Mark Schrijver
    @ractoc
    now to figure out a starting point...
    I'm thinking of making it a whole series, starting from the beginning, like I did with the unit testing one as well
    might require some review from you from time to time, see if I'm not talking rubish...
    I could add you as a reviewer for this?
    Per-Åke Minborg
    @minborg
    Sure thing. I’d love to!
    Mark Schrijver
    @ractoc
    Just PM me the username and email address you would like to use and I'll set you up
    you should then get an email with all you need (I thinkg, never actually done this before)
    Mark Schrijver
    @ractoc
    nm, just took them from you gitter profile...
    Mark Schrijver
    @ractoc
    set you up as editor, just search for posts about speedment since you can noq effectively see and edit everything...
    Per-Åke Minborg
    @minborg
    Found it. I am in now! Thanks!
    Mark Schrijver
    @ractoc
    cool, I started the first tutorial of the series yesterday, Speedment Basics
    Per-Åke Minborg
    @minborg
    Looks good! Let me know when you would like input!
    Mark Schrijver
    @ractoc
    the aim for that one is to explain how to go from just having the database to having the fully generated code you can then use in your application, strictly based on Maven
    Per-Åke Minborg
    @minborg
    Sounds like a balanced aim
    Mark Schrijver
    @ractoc
    and from there I'm planning to go layer by layer till there is a fully working rest microservice
    Per-Åke Minborg
    @minborg
    :-)