Skip to content

Kpmp 6335 fix dupes#206

Merged
rlreamy merged 3 commits intodevelopfrom
KPMP-6335_Fix_Dupes
Mar 5, 2026
Merged

Kpmp 6335 fix dupes#206
rlreamy merged 3 commits intodevelopfrom
KPMP-6335_Fix_Dupes

Conversation

@zwright
Copy link
Contributor

@zwright zwright commented Mar 4, 2026

Summary by CodeRabbit

  • Chores
    • Updated RT expression data records to use a composite primary key combining identifier, gene symbol, and p-value for improved data uniqueness.
    • Added comprehensive tests to validate the composite key implementation and behavior.

@coderabbitai
Copy link

coderabbitai bot commented Mar 4, 2026

Walkthrough

Introduces a composite primary key for the RTExpressionDataAllSegments JPA entity by adding an @IdClass annotation and marking id, geneSymbol, and pVal as identifier fields. A new RTExpressionDataId class is created to represent the composite key along with supporting unit tests.

Changes

Cohort / File(s) Summary
Entity Composite Key Configuration
src/main/java/org/kpmp/geneExpression/RTExpressionDataAllSegments.java
Added @IdClass(RTExpressionDataId.class) annotation and marked geneSymbol and pVal fields with @Id to form a three-field composite primary key (id, geneSymbol, pVal). Updated imports to use wildcard jakarta.persistence import.
Composite Key Value Object
src/main/java/org/kpmp/geneExpression/RTExpressionDataId.java
New serializable class with three fields (id, geneSymbol, pVal), default and all-args constructors, getters/setters for all fields, and overridden equals and hashCode methods based on all three fields.
Unit Tests
src/test/java/org/kpmp/geneExpression/RTExpressionDataIdTest.java
New test class covering RTExpressionDataId functionality with tests for getter/setter behavior, parameterized constructor initialization, and equals/hashCode contract compliance including null handling.
✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch KPMP-6335_Fix_Dupes

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (3)
src/test/java/org/kpmp/geneExpression/RTExpressionDataIdTest.java (1)

31-45: Consider adding a test case for differing pVal.

The testEqualsAndHashCode method tests inequality when id or geneSymbol differ, but does not test when only pVal differs. Since pVal is part of the composite key, consider adding:

RTExpressionDataId id5 = new RTExpressionDataId(1, "ALB", 0.99);
assertNotEquals(id1, id5);
src/main/java/org/kpmp/geneExpression/RTExpressionDataId.java (1)

6-10: Consider adding serialVersionUID for Serializable class.

Since RTExpressionDataId implements Serializable, it's recommended to define a serialVersionUID to ensure consistent serialization/deserialization behavior across JVM versions.

 public class RTExpressionDataId implements Serializable {
+    private static final long serialVersionUID = 1L;
 
     private Integer id;
src/main/java/org/kpmp/geneExpression/RTExpressionDataAllSegments.java (1)

13-27: Minor: Inconsistent indentation in @Id field declarations.

The indentation is inconsistent between the @Id annotated fields - id uses tabs while geneSymbol and pVal appear to use spaces. Consider normalizing the formatting for consistency.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 7f96a626-3f96-4b4a-b7eb-a4628ae90aa8

📥 Commits

Reviewing files that changed from the base of the PR and between f3931de and fe34d67.

📒 Files selected for processing (3)
  • src/main/java/org/kpmp/geneExpression/RTExpressionDataAllSegments.java
  • src/main/java/org/kpmp/geneExpression/RTExpressionDataId.java
  • src/test/java/org/kpmp/geneExpression/RTExpressionDataIdTest.java

@rlreamy rlreamy merged commit 2d4956f into develop Mar 5, 2026
1 check passed
@rlreamy rlreamy deleted the KPMP-6335_Fix_Dupes branch March 5, 2026 20:13
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.

2 participants