Skip to main content
3 votes

Simple Banking application in Spring boot, JPA, REST where balance can be transferred among predefined accounts and transaction history retrievable

Your implementation is good. I would suggest following points to improve: Use @GetMapping, @PostMapping and the others instead ...
i.bondarenko's user avatar
3 votes
Accepted

Inserting large number of rows into database with Spring boot

It makes sense to me that JDBC with prepared statements would win that contest, as we don't have to keep re-parsing the same old SQL command. Batch size before COMMIT tends to be pretty important. ...
J_H's user avatar
  • 30.6k
3 votes

Bank exercise with Java Spring Boot and JPA

Welcome to code review! I have some comments about the data structure from banking point of view. Users usually have more than one account. E-mail is not a unique identifier. The assumption that ...
TorbenPutkonen's user avatar
3 votes

Property Change Listener for Entity Management

The problem is not in your Services. The problem is the circular dependency you have modeled from Permissions to Users: ...
Vogel612's user avatar
  • 25.2k
2 votes

Accepting any object and returning the object

That nested for loop looks prime for some Java 8 stream refactor. Also, I would drop the isEmpty checks and just make sure the ...
Lee's user avatar
  • 121
2 votes

Suitable way for Validating JPA Entities in Spring Boot

The approach is ok, although it depends on the context. If the application receives AppUserDto in the controller layer, doing the validation in the service layer ...
Marc's user avatar
  • 5,604
2 votes
Accepted

How to avoid duplicate code due to the impossibility of using multiple inheritance

I've had a lot of occasions to face similar problems, but must admit that there is no ideal solution. It is difficult to avoid code duplications in JPA entities definitions. However, there are some ...
Antot's user avatar
  • 3,657
1 vote
Accepted

Hibernate - entity design with multiple dependencies

I don't see anything wrong with your approach. Another option is to add a PhoneNumberType to the PhoneNumber table. In any case you should ensure the table has ...
dustytrash's user avatar
  • 2,406
1 vote
Accepted

JPA method to update roles for users

The biggest optimization potential I see is readability. Note that forEach() does not have any advantage over a good-ole-for-loop from a technical perspective, but in many cases makes the code more ...
mtj's user avatar
  • 4,822
1 vote

JPA method to update roles for users

Well, you created a good code so far. Your lamda is OK. But there are some things about naming which could be improved About the API setRolesByUserId, it is OK to ...
kidnan1991's user avatar
1 vote

Inserting 100000 records to MySQL takes too much time

Using batch-inserting is one of the methods to decrease a saving time, but still not enough to handle 100k records in 5 or less seconds due to ORM internal mechanism. I suggest you to look into your ...
Sardor Navruzov's user avatar
1 vote

Inserting 100000 records to MySQL takes too much time

I think it's your transaction set up. Without being able to run the code I would guess that the transaction overhead is the bottleneck. Check out the Insert example here: https://docs.jboss.org/...
Alzoid's user avatar
  • 141
1 vote

Check repository for a nested entity

In DDD, an aggregate is composed of a root entity (the Product) and one or more child entities (the ProductCategory). Business ...
Rogério's user avatar
  • 111
1 vote

Check repository for a nested entity

It appears that this Product entity is meant to be a POJO. POJOs should be responsible only for holding the relevant data in memory to be accessed by, and possibly ...
Joe C's user avatar
  • 1,085

Only top scored, non community-wiki answers of a minimum length are eligible