Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: Spring with exposed or jpa? #1504

Open
gunslingor opened this issue May 2, 2022 · 1 comment
Open

Question: Spring with exposed or jpa? #1504

gunslingor opened this issue May 2, 2022 · 1 comment

Comments

@gunslingor
Copy link

I'm looking at an old spring boot kotlin grade app I wrote and I am rebuilding... trying to understand why I used exposed instead of jpa, which I suspect could also be kotlin.

What do you think, which should I have used or is it arbitrary?

Any input appreciated.

@heli-os
Copy link

heli-os commented May 19, 2022

Hi @gunslingor 😆

i am an engineer developing web server application using Java/Kotlin and SpringBoot. At that time, DataSource Access used JPA and QueryDSL a lot.

I do a lot of clean architecture development based on Kotlin + JPA, but I felt some inconvenience.

  1. Doesn't work properly without plugin(because kotlin class and function are final by default and does not have default constructor)
  2. Entities cannot be used as data classes.
  3. Entity is not suitable for handling immutable objects, so we have to use var not val
  4. when developing with a domain-oriented clean architecture, we cannot use the powerful features of JPA at all. if using JPA, Simply map code-level logical relationships and easily send queries. But it can be done more easily with spring-data-jdbc or other ORM.

In addition, when developing with a clean architecture, it is difficult to comfortably use JPA's Persistence Layer primary cache function including dirty-checking.

So I'm using spring-data-jdbc + jooq, and now I'm using Exposed. It is not the answer.

This solution is also inconvenient, but I've been looking for a more lightweight library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants