Skip to content

Tag: spring-data-jpa

How use generic entity name in JPQL

I have three tables with same column name and types, what changes is just the table name. Example: | TABLE1 | TABLE2 | TABLE3 | | —— | —— | ——- | | ID | ID | ID | | NAME | NAME | NAME | | FOO | FOO | FOO | | BAR | BAR | BAR |

Spring Find by unique properties

Given 1 relational table Doctor_ID Client_ID 2 2 2 3 2 4 3 5 4 2 4 3 And I want all the occurrences where client_id is not equals to 3, ignoring the same doctor_id. In this example, I would only get the 4th row… Doctor_ID Client_ID 3 5 How could I achieve something like that? Answer This query with

Spring Data JPA: FindBy on Join Column

I have setup two entities like below in a one-to-one mapping and I am trying to query on the joincolumn like below in my repository: In my BRepository.java, I am trying to do this: I get the following error: No property a found for type B! Did you mean ‘aId’? Is this not the right way to query on …

How to ignore a field from DB [closed]

Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 1 year ago. Improve this question I have a list of persons in DB everyone having a CV field which is a MultiPart File in Spring…