Part 2 - Infinite RecursionStackOverflow Problem Solved in JPA

preview_player
Показать описание
Infinite RecursionStackOverflow Problem Solved in JPA using
JsonManagedReference,
JsonBackReference,
JsonIdentityInfo

Рекомендации по теме
Комментарии
Автор

As a jr. dev making his first own application from scratch for work: THANK YOU! I simply didnt know about the annotation! Big help!

timarbeit
Автор

Wow bro lovely, I was running over the internet all over but did not find the solution.... Amazing bro, thankk you so much

sagarthapliyal
Автор

You're the best, thanks so much! Subscribed!

juanpablosuarezsoler
Автор

I'm Brazilian, you helped me a lot, thank you

felipeavila
Автор

This video helped me a lot Thanks really perfect

manee
Автор

Hello in case of microservices we have to put annotation on DTOS or Entity?

himanshunegi
Автор

Thanks my bro... You have earned the sky

alexdev__
Автор

Thank you so much . I just have a question. Can it work for more than one relationship, that is, if this same departments table were related to the Professors table, can you use the @JsonBackReference and @JsonManagedReferences annotations for these tables?

eleafarpan
Автор

Hi, thanks for this tutorial. please which database are you using? please can you make a video on how u link it on spring?

emmanlife
Автор

Thank you very much, I'm Brazuca and you helped me a lot

luisguilherme
Автор

Thanks so much. The video is really informational. I have a doubt, will this apply for one to one bidirectional relationships also

MrFahimansari
Автор

I'm using jsonidentify but i still got problem with many to one relation, when i show json data from the child, the parent data still repeat it's child list, i want to remove it, please help me

uclongo
Автор

Thanks so much! great video but how could you solve this problem with many to many relation? I'd appreciate very much your answer :)

Andrescudero
Автор

does it work on files that have multiple one to many and many to one relationship?

wilsonho
Автор

Hey is there any way to do this without any extra annotation, because in my previous company my manager use to do bi-directional mapping with any extra annotation, and all data was coming perfectly.

Aakashkumar-pcxs
Автор

sir please make font large so mobile user can see easily

RamKumar-rggr
Автор

Hello sir, I am getting same issue with many-to-many relationship with composite primary key in jpa using third table

Can you please suggest how to resolve this issue

thiru
Автор

i am getting only id values instead of complete object please help me..

amarnathgreentech
Автор

LOMBOK USERS: If you're scratching your head because none of this works, it's because of Lombok! It's generating .toString, .equals, and .hashCode methods in the Student class that calls these same methods in the Department class, which in turn calls the Student methods and on and on!

The solution is to put the following annotations above the department property in Student class:

@ToString.Exclude
@EqualsAndHashCode.Exclude

That will omit the company property from these methods, breaking the recursion loop. Hope this helps!

HandledToaster
Автор

Hi Kindson,

can you please help me solve this because it is not working for me, if there is any setting required please let me know. thanks in advance.

@Data
@Entity
@Table(name = "address")
public class Address {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int id;

@Column(name ="address")
private String address;

@ManyToOne
@JoinColumn(name = "user_id")
@JsonBackReference
private User user;
}


@Data
@Entity
@Table(name = "user")
public class User {

@Id
@Column
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int id;

@Column(name ="username")
private String name;

@OneToMany( mappedBy = "user", cascade = CascadeType.ALL, targetEntity = Address.class)
// @JoinColumn(name = "user_id", referencedColumnName = "id")
@JsonManagedReference
private Set<Address> addresses = new HashSet<Address>();

}

bollywoodssongs
visit shbcf.ru