Skip to content
Advertisement

Tag: spring-data-jpa

Custom Repository Implementation is not being recognized

I am currently working on a project where I have created the following custom Repository: The print statement “I got called with: ” never gets called. So for whatever reason Spring Boot is not running the method through my custom implementation. Any suggestions? Any help is much appreciated Edit: Here is the code that injects and uses the Repository in

Get values from User and update into mysql database in Springboot Controller

I’m developing a Banking system Project Where User Should be able to create an account in any available branch. Branch Creation will be maintained by admin. I had two tables(Entities) like BranchDetails and AccountDetails. The BranchId Column is the primary key in BranchDetails and Foreign key in AccountDetails. Now When user Creates an account, he will input the Preferred Branch

How to insert all enums into database?

We have a list of ENUMS for different purposes. Sample Enum: we use .sql file to save this enums, Problem: We need to write values two times (One in enum and another one .sql statement) It seems not efficient way, Is any other way to save ENUMS to avoid this repetition? Answer From the above mentioned details what I understood

Query on distant/not directly related entity

I’m trying to create a query with a where clause on a not directly related table. My table/entity structure looks like this: I have got an entity Entity with a ManyToOne relation to Relation. Relation has a ManyToMany relation to DistantRelation. I have a JpaSpecificationExecutor<Entity> on which I call findAll() with a Specification<Entity>. How do I setup my entity and/or

Jpa unit test – Service – entity manager null

This is what I tried: the error that I get is ‘ Runner org.junit.internal.runners.ErrorReportingRunner (used on class com.unibuc.AWBD_Project_v1.services.ServiceTest) does not support filtering and will therefore be run completely. Test class should have exactly one public zero-argument constructor’ Here is the LocationService: Answer Hello there is 3 issues in your test code. 1 you should remove the EntityManager entityManager from your

Advertisement