Implemented User Profilepicture | PLEASE check again if implemented right

This commit is contained in:
2026-01-21 02:28:38 +01:00
parent d92b71179a
commit 159c03142a
6 changed files with 124 additions and 0 deletions
@@ -59,6 +59,9 @@ public class User {
@OneToOne(mappedBy = "user", cascade = CascadeType.ALL, orphanRemoval = true)
private StatsList statsList;
@OneToOne(mappedBy = "user", cascade = CascadeType.ALL, orphanRemoval = true)
private ProfileImageEntity profileImage;
public User() {}
// public User(Long id, String publicName, String privateName, String email, String password, VisibilityPrivacy visibilityPrivacy, String friendCode, Set<Trip> trips, Set<Friendship> friendships, Set<RoleName> roles) {
@@ -84,6 +87,7 @@ public class User {
this.roles = new HashSet<>();
this.roles.add(RoleName.USER);
this.statsList = new StatsList(this);
this.profileImage = new ProfileImageEntity(this, null);
}
public Long getId() {
@@ -173,4 +177,12 @@ public class User {
public StatsList getStats() { return statsList;}
public void setStats(StatsList statsList) { this.statsList = statsList; }
public ProfileImageEntity getProfileImage() {
return profileImage;
}
public void setProfileImage(ProfileImageEntity profileImage) {
this.profileImage = profileImage;
}
}