Skip to content

Commit

Permalink
fix: add referenced column names
Browse files Browse the repository at this point in the history
  • Loading branch information
GODrums committed Aug 18, 2024
1 parent 5ff5a8b commit 8e625b3
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ public class Comment {
* The pullrequest of the Comment entity.
*/
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "c_connection_id")
@JoinColumn(name = "c_connection_id", referencedColumnName = "id")
private CommentConnection connection;

}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,4 @@ public class CommentConnection {

@OneToMany(mappedBy = "connection", fetch = FetchType.LAZY)
private List<Comment> nodes;

@OneToOne(mappedBy = "comments", fetch = FetchType.LAZY)
private Pullrequest pullrequest;
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import de.tum.in.www1.hephaestus.codereview.comment.CommentConnection;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import jakarta.persistence.Transient;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.FetchType;
Expand Down Expand Up @@ -85,13 +86,10 @@ public class Pullrequest {
* The comments of the Pullrequest entity.
*/
@OneToOne(optional = false)
@JoinColumn(name = "c_connection_id")
@JoinColumn(name = "c_connection_id", referencedColumnName = "id")
private CommentConnection comments;

/**
* The repository of the Pullrequest entity.
*/
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "pr_connection_id")
@JoinColumn(name = "pr_connection_id", referencedColumnName = "id")
private PullrequestConnection connection;
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,4 @@ public class PullrequestConnection {

@OneToMany(mappedBy = "connection", fetch = FetchType.LAZY)
private List<Pullrequest> nodes;

@OneToOne(mappedBy = "pullRequests", fetch = FetchType.LAZY)
private Repository repository;
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class Repository {
private String url;

@OneToOne(optional = false)
@JoinColumn(name = "connection_id")
@JoinColumn(name = "connection_id", referencedColumnName = "id")
private PullrequestConnection pullRequests;

@Column(name = "added_at")
Expand Down

0 comments on commit 8e625b3

Please sign in to comment.