Questions tagged as 'spring-data'

1
answer

Manual configuration of Spring Data

I'm trying to use SpringData in a JFace / SWT project. Because the CrudRepository auto-deployment feature is fantastic and very advantageous. For this, I include here in the classpath the necessary SpringData things: Spring Data Commons, Spri...
asked by 15.10.2017 / 14:19
2
answers

Query with dynamic column spring data

I need to perform a select using the @Query of spring data, however I need to pass the column name by parameter Example: @Query("SELECT g FROM Grupo g where g.? = ?") Page<Grupo> findTeste(String campo, String valor); To call meth...
asked by 22.08.2016 / 14:37
2
answers

How to use MySQL view's with Spring Data and eclipselink

In the development of my project I came across a select that will require a lot of application performance, since it consists in the use of two join's. Soon I came to mind creating a view in MySQL, but the problem is that I never used it consume...
asked by 19.11.2014 / 20:32
1
answer

How to do a find with pagination and search term at the same time with Spring data?

Hello, my question is the following. I want to do a search by passing a PageRequest and an Object or some search terms and get a list back. For example: List getList (PageRequest page); In this case I want the search to return the records...
asked by 18.01.2018 / 04:44
1
answer

How do I return in json the foreign key in Spring Boot?

As you can see, he is returning cities without any problems at the following URL: http://localhost:8080/cidades , please note: Thisisadirectreturnfromthedatabasewithselect*fromcidade,canyouseeanydifference? Notethatinthestatus_codeattr...
asked by 02.02.2018 / 19:46
1
answer

How do I use Page in this query instead of List?

@Query(value="SELECT * FROM prot_protocolo where status = 'PENDENTE' AND departamento_id=?", nativeQuery=true) public List<Protocolo> findByProtocolosPorDepartamento(String id); The page does not accept nativeQuery, of the error when...
asked by 24.10.2016 / 15:45
1
answer

OneToOne returning wrong value

Please help me please, I have a problem here and I'm banging my head to resolve this for hours. I use Spring in the project and I have the following relationship in one of my models: @OneToOne() @JoinColumn(name = "ITE_COD_INTERNO") @NotFound(...
asked by 24.11.2017 / 13:36
2
answers

Error in request Delete in Spring: console indicates that method is not supported

I am making a request via Ajax to delete a user and I get the message that the delete method is not supported, does anyone have any idea what it could be? My controller: package com.br.livraria.controller; import javax.servlet.http.HttpServ...
asked by 25.10.2017 / 14:53
1
answer

Perform a date search on a timestamp column using spring data

I am trying to perform a search only for the current date in a timestamp column, ie without informing the time, but only the date. Template: @DateTimeFormat(pattern = "dd/MM/yyyy hh:mm") @Temporal(TemporalType.TIMESTAMP) @Column(name = "d...
asked by 20.09.2017 / 15:19
2
answers

Extend findAll with custom filters

I'm trying to extend findAll from my JPA repository to make custom filters. I did some research and found some ideas of use with Predicates and related but did not identify something that worked in a practical way. I would like to know if...
asked by 26.05.2015 / 16:16