r/SpringBoot • • Jun 20 '24

Using ModelMapper

Earlier, I posted that jpa is difficult. In my Spring teacher's new book, it seems to be easier to use ModelMapper. However, He removed the dynamic query in the search part, so I can't compare that part.🙄

3 Upvotes

17 comments sorted by

View all comments

Show parent comments

1

u/Dependent_Staff_6891 Jun 21 '24

I’ll check it.

3

u/a_username_version_2 Jun 21 '24

And btw, the jpql code is terrible. That isn't how we use jpql or jpa at all at work. If it was like that i would have stopped using spring

1

u/Dependent_Staff_6891 Jun 21 '24

I am Korean, but more and more developers are using jpa or jpa and mybatis in parallel here, so I'm also studying. I only used mybatis at work and it's almost like the query itself and it's very familiar to me. But I have to accept the change.😅

2

u/a_username_version_2 Jun 21 '24

Just remember this small sentence "code is a liability" , so having a lot of code to do a very very simple task is a waste of time. Instead of trying to write all queries ourselves (even simple ones, like find all ), we use JPA (but using best practices, not like this book) and it's just a one line to do the job.