I have the following service
public List<Factura> listFactura(String campo1, String campo2, String Campo3);
and its implementation
@Autowired
private FacturaRepository repository;
public List<Factura> listFactura(String campo1, String campo2, String campo3){
return repository.findByParameters(campo1, campo2, campo3);
}
and the Reporsitory
public interface FacturaRepository extends JpaRepository<Factura, Integer>{
@Query(name="detalleFactura", nativeQuery=true)
public List<Factura> findByParameters(String campo1, String campo2, String campo3);
}
This is my entity
@Entity
@Table(name="FACTURA")
public class Factura implements Serializable{
@Id
@Column(name="ID_FACTURA")
private int idFactura;
@Column(name ="CAMPO1")
private String campo1;
@Column(name ="CAMPO2")
private String campo2;
@Column(name ="CAMPO3")
private String campo3;
//sus get y set
}
and I have an xml file, where the query goes,
<named-native-query name="detalleFactura"
result-class="mx.com.proyect.entidades.Factura">
SELECT * FROM FACTURA F
WHERE F.campo1=?1, F.campo2=?2 and F.campo3=?#
</named-native-query>
<sql-result-set-mapping name="mx.com.proyect.entidades.Factura">
<entity-result>
<field-result name="idFactura" column="ID_FACTURA"/>
<field-result name="campo1" column="CAMPO1"/>
</entity-result>
</sql-result-set-mapping
but when you lift the application, send me that error What do I need? Something is missing?
Error creating bean with name "InvoiceRepository", No property parameters found for type Invoice