Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create FeedbackResponse and FeedbackResponseComment entities #12135

Conversation

cedricongjh
Copy link
Contributor

@cedricongjh cedricongjh commented Feb 25, 2023

Part of #12048

Outline of Solution

  • Created the FeedbackResponse and FeedbackResponseComment entities.
  • For FeedbackResponse, answer is question specific, and thus placed into subtypes, similar to how it's done for FeedbackQuestion.
  • Moved FeedbackParticipantTypeListConverter from FeedbackQuestion into BaseEntity as its used by FeedbackResponseComment.
  • Added OneToMany association from FeedbackQuestion to FeedbackResponse


@Override
public int hashCode() {
// FeedbackResponseComment ID uniquely identifies a Feedback Response Comment.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// FeedbackResponseComment ID uniquely identifies a Feedback Response Comment.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

import jakarta.persistence.Entity;

/**
* Represents a text response.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Represents a text response.
* Represents a feedback numerical scale response.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed!

Comment on lines 49 to 51
@OneToOne
@JoinColumn(name = "giverSectionId")
private Section giverSection;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not a OneToOne relationship. Multiple responses can have the same giverSection.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right, changed to ManyToOne

Comment on lines 56 to 58
@OneToOne
@JoinColumn(name = "receiverSectionId")
private Section receiverSection;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed!

Comment on lines 153 to 156
/*
* The old FeedbackResponse checks invalidity info for courseId and sessionName,
* which do not exist on this new entity.
*/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/*
* The old FeedbackResponse checks invalidity info for courseId and sessionName,
* which do not exist on this new entity.
*/

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed


@Override
public int hashCode() {
// FeedbackQuestion ID uniquely identifies a Feedback Response.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// FeedbackQuestion ID uniquely identifies a Feedback Response.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed!

*/
@Entity
@Table(name = "FeedbackReponseComments")
public abstract class FeedbackResponseComment extends BaseEntity {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public abstract class FeedbackResponseComment extends BaseEntity {
public class FeedbackResponseComment extends BaseEntity {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed

Comment on lines 43 to 49
@OneToOne
@JoinColumn(name = "giverSectionId")
private Section giverSection;

@OneToOne
@JoinColumn(name = "receiverSectionId")
private Section receiverSection;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As above, should not be OneToOne

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed to ManyToOne

@samuelfangjw samuelfangjw merged commit 69ebebb into TEAMMATES:v9-migration Feb 26, 2023
@wkurniawan07 wkurniawan07 added s.ToMerge The PR is approved by all reviewers including final reviewer; ready for merging c.Task Other non-user-facing works, e.g. refactoring, adding tests labels Jan 21, 2024
@wkurniawan07 wkurniawan07 added this to the V9.0.0-beta.0 milestone Jan 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c.Task Other non-user-facing works, e.g. refactoring, adding tests s.ToMerge The PR is approved by all reviewers including final reviewer; ready for merging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants