Add Line segments infos into database for line creation#787
Add Line segments infos into database for line creation#787
Conversation
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughThe changes introduce support for managing line segments within line creation entities. A new Changes
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@src/main/java/org/gridsuite/modification/server/entities/equipment/creation/LineCreationEntity.java`:
- Around line 44-49: LineCreationEntity currently maps the
List<LineSegmentEntity> lineSegments without preserving order; update the
mapping on lineSegments to add an `@OrderColumn` (e.g., `@OrderColumn`(name =
"line_segments_order") or similar) so the list index is persisted and round-trip
order is stable, and explicitly set the join table name in the `@JoinTable` (e.g.,
name = "line_creation_line_segments") rather than relying on Hibernate defaults
so Liquibase schema matches; keep the existing joinColumns, inverseJoinColumns
and uniqueConstraints but move them into the explicitly named `@JoinTable` and
ensure the OrderColumn column name does not conflict with existing constraints.
In
`@src/main/java/org/gridsuite/modification/server/entities/equipment/creation/LineSegmentEntity.java`:
- Around line 66-75: fromLineSegmentsEntity currently dereferences its input
list and will NPE if lineSegmentEntities is null; make it null-safe by returning
Collections.emptyList() (or new ArrayList<>()) when lineSegmentEntities is null,
otherwise map each LineSegmentEntity to a LineSegmentInfos as it does now,
updating the method body in fromLineSegmentsEntity to check for null before
iterating; this mirrors the null-safety in toLineSegmentEntities and avoids
breaking LineCreationEntity.toLineCreationInfosBuilder.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: e37c68b4-5f4e-4f48-8d9e-95d0b0d7429d
📒 Files selected for processing (4)
pom.xmlsrc/main/java/org/gridsuite/modification/server/entities/equipment/creation/LineCreationEntity.javasrc/main/java/org/gridsuite/modification/server/entities/equipment/creation/LineSegmentEntity.javasrc/main/resources/db/changelog/db.changelog-master.yaml
...n/java/org/gridsuite/modification/server/entities/equipment/creation/LineCreationEntity.java
Show resolved
Hide resolved
...in/java/org/gridsuite/modification/server/entities/equipment/creation/LineSegmentEntity.java
Show resolved
Hide resolved
Signed-off-by: basseche <bassel.el-cheikh_externe@rte-france.com>
c09f515 to
5ff3748
Compare
PR Summary
Add Line segments entity table related to line creation