0
I need to do a search in the bank where I have an object that is filled with everything except the id and check if it has any object that gives a "Match" with it and return it! I thought to make a @Query and check if all are equal, only my boss said that this is not the default and has a JPA Repository Example that I only found it this way here:
public interface LeagueRepository extends JpaRepository<League, Long>{
League findByName(String name);
boolean existsByTeams(Team team); }
Where you pass an object that is within your entity and it checks whether it has in tau column this object. But he doesn’t check the entity he’s in.
For example something like: "Obs this code below does not work"
public interface LeagueRepository extends JpaRepository<League, Long>{
League findByName(String name);
boolean exists(League league); }
Where the Legue object has everything but id.
The solution caters thank you very much.
– Matheus Felix