java.lang.Object
fr.utc.miage.sporttrack.entity.user.communication.Comment

@Entity public class Comment extends Object
JPA entity representing a comment or interaction left by an athlete on an activity within the SportTrack application.

Each comment is associated with an author (athlete), a target activity, an interaction type (e.g., like, cheer), and an optional textual content. The creation timestamp is automatically set upon persistence.

Author:
SportTrack Team
  • Constructor Details

    • Comment

      public Comment()
      No-argument constructor required by JPA.
  • Method Details

    • onCreate

      protected void onCreate()
      Lifecycle callback that automatically sets the creation timestamp before the entity is first persisted.
    • getId

      public int getId()
      Returns the unique identifier of this comment.
      Returns:
      the comment's database identifier
    • setId

      public void setId(int id)
      Sets the unique identifier of this comment.
      Parameters:
      id - the database identifier to assign
    • getAuthor

      public Athlete getAuthor()
      Returns the athlete who authored this comment.
      Returns:
      the author Athlete
    • setAuthor

      public void setAuthor(Athlete author)
      Sets the athlete who authored this comment.
      Parameters:
      author - the author Athlete to assign
    • getActivity

      public Activity getActivity()
      Returns the activity to which this comment is attached.
      Returns:
      the associated Activity
    • setActivity

      public void setActivity(Activity activity)
      Sets the activity to which this comment is attached.
      Parameters:
      activity - the Activity to associate
    • getInteractionType

      public InteractionType getInteractionType()
      Returns the interaction type of this comment.
      Returns:
      the InteractionType
    • setInteractionType

      public void setInteractionType(InteractionType interactionType)
      Sets the interaction type of this comment.
      Parameters:
      interactionType - the InteractionType to assign
    • getContent

      public String getContent()
      Returns the textual content of this comment.
      Returns:
      the comment text, or null if only an interaction type was used
    • setContent

      public void setContent(String content)
      Sets the textual content of this comment.
      Parameters:
      content - the comment text to assign
    • getCreatedAt

      public LocalDateTime getCreatedAt()
      Returns the creation timestamp of this comment.
      Returns:
      the timestamp when the comment was created
    • setCreatedAt

      public void setCreatedAt(LocalDateTime createdAt)
      Sets the creation timestamp of this comment.
      Parameters:
      createdAt - the creation timestamp to assign