-1
I’m having a small problem, my query is returning the same result on all Rows.
Example:
Code:
@NamedQuery(name = "UtilizadorPerfil.getByFilter", query = "SELECT u FROM UtilizadorPerfil u WHERE COD_UTILIZADOR = ?1 ")
public class UtilizadorPerfil implements Serializable {
private static final long serialVersionUID = -232601683121391563L;
@Id
private Long COD_UTILIZADOR;
private Long COD_PERFIL;
getters setters...
@Repository
public interface UtilizadorPerfilRepository extends JpaRepository<UtilizadorPerfil, Long> {
List<UtilizadorPerfil> getByFilter(Long cod);
}
Chamada
@Autowired
UtilizadorPerfilRepository utilPerfil;
List<UtilizadorPerfil> utilizadoresPerfis = utilPerfil.getByFilter(id);
Possible answers to possible questions:
- Yes, in the bank there is no similar result.
- There is no relation with another table, even if it is a composite table, I cannot map the other tables, I just need to look for these results.