Reputation: 103
In my attempt of using JPA with a legacy database, I've came to the conclusion I need to obtain a subset of my huge 50-60 column tables columns, since the queries generated by one single select sentence can be around 4 or 5 sheets of paper long with a endless number of joins.
I am wondering, how you experts, face this problem related mainly to performance and efficency, but also with the application's design and how you do structure your project, entities, pojos etc in a reasonable way.
About the class containing the result:
How would this interact with the dependent layers?
Upvotes: 0
Views: 1379
Reputation: 101
I would use @Query and custom code the query with a DTO representing the model needed, saves memory, also prefer Spring-Data-JDBC over JPA
Upvotes: 1
Reputation: 1816
I'd use Spring's JDBC template: https://spring.io/guides/gs/relational-data-access/
Upvotes: 0