Questions tagged as 'spring-jpa'

1
answer

Omit DTO attribute (Spring Data JPA)

Hello, I have two classes DTO (CategoryDTO and ProductDTO) in a restfull application, how can I omit a particular attribute of the ProductDTO when it is used in the CategoryDTO class? Below are the classes, the return on the Postman, and what I'm...
asked by 23.03.2018 / 14:12
3
answers

How to limit a user to only accessing their own data? [closed]

I'm developing a task list application for study, however, all users access all tasks. I wonder if anyone has implemented something like Spring Security and how they did it.     
asked by 07.03.2018 / 15:34
2
answers

Specification with Spring Data Jpa passing null parameter

I'm using Specifications Spring Data JPA, but I'm having a hard time! By not passing any parameters in the two fields I want it to return all records to me. But when doing the query it is returning me only those that have the respective two null...
asked by 28.02.2018 / 13:50
2
answers

Persisting a relationship Spring boot

I have the following Entity classes Patients @Entity @Table(name = "pacientes", schema = "sau") public class Pacientes implements Serializable { private static final long serialVersionUID = 5776384003601026304L; @Id @Generated...
asked by 17.11.2017 / 00:04
0
answers

Connect to the database dynamically by the repository class of the Spring project

I need to connect to the database dynamically, where the database connection data can be passed by parameter, below is a sketch of how I need to connect and execute the query. This code sketch below does not work when I run on my server....
asked by 02.08.2017 / 23:03
1
answer

Pass native query per parameter to JpaRepository Interface

I need to create an interface that extends the JpaRepository where I want to pass a native (select) query per parameter instead of leaving static within the @Query annotation. Instead of using @Query(value = "select * from a where a =...
asked by 11.05.2017 / 22:08
1
answer

Deleting child records with Spring JPA @ManyToOne annotation

I have the classes Presente and Reserva , as below: @Entity public class Presente { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long codigo; private String nome; //getters e setter omitid...
asked by 28.12.2016 / 23:11
2
answers

JSON Infinite when using @ManyToMany GET

I have two classes, which has a @ManyToMany relationship generating the third table described in the code below: Card package br.com.rpgnext.deck.critical.model; import com.fasterxml.jackson.annotation.*; import javax.persistence.*; imp...
asked by 10.04.2018 / 16:16
1
answer

Refactoring for Spring Data returning ListObject []

I came across a project where I have several methods in Repository of this type: @Query(value = "SELECT " + " i.uf, " + " i.cidade " + "FROM Imovel AS i " + "WHERE i.ativo = 'Sim' AND " + "...
asked by 03.08.2017 / 13:25
1
answer

Problem in scheduling for email notifications Spring and JavaMailSender

Good morning, I'm using spring with Scheduled, before using the quartz but as I uploaded the spring version I decided to abandon the quartz since the first option was enough to meet my need. In short, I have a task that sends emails, this...
asked by 02.01.2019 / 14:09