Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 10, 2025

Description

Modernizes the xapi-server sample by refactoring StatementEntity to use Lombok annotations, reducing boilerplate from 79 to 36 lines. Also reverts commit dd04a64 which incorrectly added Lombok configuration to the core xapi-model-spring-boot-starter module.

Changes

xapi-server sample (Lombok refactoring):

  • StatementEntity.java: Replaced explicit getters/setters/constructors with @Getter, @Setter, @NoArgsConstructor, @AllArgsConstructor (following JPA entity best practices by avoiding @Data which generates problematic equals(), hashCode(), and toString() methods)
  • pom.xml: Added Lombok dependency and maven-compiler-plugin annotation processor configuration
  • lombok.config: Created with standard settings for code coverage, builder naming, and constructor properties (consistent with xapi-model)
  • README.md: Added Lombok usage documentation with IDE setup guidance

xapi-model-spring-boot-starter (reversion of dd04a64):

  • Removed lombok.config
  • Removed LombokProcessingTests.java
  • Removed Lombok dependency and maven-compiler-plugin configuration

Before:

public class StatementEntity {
  @Id private UUID id;
  @Type(JsonType.class)
  @Column(columnDefinition = "BLOB")
  private JsonNode statement;

  public StatementEntity() {}
  
  public StatementEntity(UUID id, JsonNode statement) {
    this.id = id;
    this.statement = statement;
  }
  
  public UUID getId() { return id; }
  public void setId(UUID id) { this.id = id; }
  public JsonNode getStatement() { return statement; }
  public void setStatement(JsonNode statement) { this.statement = statement; }
}

After:

@Entity
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
public class StatementEntity {
  @Id private UUID id;
  @Type(JsonType.class)
  @Column(columnDefinition = "BLOB")
  private JsonNode statement;
}

Checklist:

  • Public methods are documented
  • Public methods are tested
  • New and existing tests pass when run locally
  • There are no new warnings or errors
Original prompt

This section details on the original issue you should resolve

<issue_title>[Chore]: Refactor sample server StatementEntity.java to use Lombok for clarity and simplicity</issue_title>
<issue_description>### What

Refactor StatementEntity.java in the sample server to use Lombok annotations (@DaTa, @Getter, @Setter, @NoArgsConstructor, @AllArgsConstructor). Remove explicit getter, setter, constructor, and other boilerplate code in favor of Lombok. Update the README if necessary to clarify that this is a Lombok-based sample for testing.

Why

Making a Lombok-based sample will modernize the example, reduce boilerplate, and help developers or testers verify Lombok integration. It will also clarify best practices for Lombok in this project and make it easier for contributors to get started.

Notes

Review anywhere StatementEntity is referenced to ensure compatibility. If this change has implications for contributors or users, add a clarifying note in the README about Lombok as a sample dependency.</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: thomasturrell <1552612+thomasturrell@users.noreply.github.com>
Copilot AI changed the title [WIP] Refactor StatementEntity.java to use Lombok annotations Refactor sample server StatementEntity to use Lombok and revert dd04a64 Dec 10, 2025
Copilot AI requested a review from thomasturrell December 10, 2025 12:53
@thomasturrell thomasturrell marked this pull request as ready for review December 10, 2025 16:59
Copilot AI review requested due to automatic review settings December 10, 2025 16:59
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR modernizes the xapi-server sample by refactoring StatementEntity to use Lombok annotations and reverts an incorrect addition of Lombok configuration to the xapi-model-spring-boot-starter core module.

  • Reduces StatementEntity boilerplate from 79 to 34 lines using @Data, @NoArgsConstructor, and @AllArgsConstructor
  • Removes incorrectly added Lombok configuration from xapi-model-spring-boot-starter (commit dd04a64)
  • Adds Lombok usage documentation to the xapi-server README with IDE setup guidance

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
xapi-model-spring-boot-starter/src/test/java/dev/learning/xapi/autoconfigure/model/LombokProcessingTests.java Removed test file that was incorrectly added to core module
xapi-model-spring-boot-starter/pom.xml Removed Lombok dependency and compiler plugin configuration from core module
xapi-model-spring-boot-starter/lombok.config Removed Lombok configuration file from core module
samples/xapi-server/src/main/java/dev/learning/xapi/samples/xapiserver/StatementEntity.java Refactored JPA entity to use Lombok annotations instead of explicit getters/setters/constructors
samples/xapi-server/pom.xml Added Lombok dependency and annotation processor configuration
samples/xapi-server/README.md Added documentation section explaining Lombok usage and IDE setup requirements

… practices

Co-authored-by: thomasturrell <1552612+thomasturrell@users.noreply.github.com>
@sonarqubecloud
Copy link

@thomasturrell thomasturrell merged commit ba14c7a into main Dec 13, 2025
4 checks passed
@thomasturrell thomasturrell deleted the copilot/refactor-statemententity-using-lombok branch December 13, 2025 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Chore]: Refactor sample server StatementEntity.java to use Lombok for clarity and simplicity

2 participants