feat: Implement entity database modeling with PostgreSQL entities and repositories#6
Merged
qowlgur121 merged 6 commits intoAug 10, 2025
Conversation
- Replace QueryDSL with OpenFeign fork to fix SQL injection vulnerability - Update DJL and Commons Lang3 to latest secure versions - Modernize QueryDSL configuration for Spring Boot 3.3 compatibility - Fix deprecated buildDir and annotation processor warnings
- Update gradlew script with latest Gradle wrapper improvements - Add missing gradle-wrapper.jar for self-contained builds - Include gradlew.bat for Windows development support - Ensures all team members can build without local Gradle installation
- Set platform: linux/amd64 for all Docker services - Resolves compatibility issues on Apple Silicon (M1/M2) machines - Ensures consistent behavior across different hardware architectures
…repositories - Add IngestionStatus enum with complete document processing lifecycle states - Implement SourceDocument entity with file metadata and ingestion tracking - Implement DocumentChunk entity with hierarchical parent-child relationships - Create SourceDocumentRepository with advanced query methods for status filtering - Create DocumentChunkRepository with hierarchy navigation and cascade operations - Add comprehensive Flyway migration V1 for PostgreSQL table creation with indexes - Implement complete test suite with TestContainers integration testing - Include entity unit tests with Builder pattern validation - Add repository integration tests with real PostgreSQL container testing - Cover CASCADE delete operations, hierarchy queries, and performance optimizations Resolves #4
- Remove redundant 'core' package nesting (com.opencontext.core.* → com.opencontext.*) - Eliminate duplicate IngestionStatus enum, use team member's implementation - Maintain full entity relationship functionality and test coverage - Update all imports to reflect new package structure This resolves package structure inconsistencies and enables seamless integration with common modules established in PR #5.
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR implements a comprehensive entity database modeling system for the OpenContext ingestion pipeline, establishing the foundational data layer with PostgreSQL entities and repositories. The implementation follows the Service-Repository pattern with JPA entity modeling and includes extensive test coverage using TestContainers.
- Complete PostgreSQL entity layer with
SourceDocumentandDocumentChunkentities featuring hierarchical relationships - Comprehensive repository interfaces with advanced query methods for document management and chunk navigation
- Full database schema with Flyway migrations, proper indexing, and CASCADE relationships
Reviewed Changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| docker-compose.yml | Adds platform specification for consistent cross-platform container deployment |
| core/build.gradle | Updates dependencies for security patches and removes deprecated QueryDSL plugin |
| V1__Create_source_documents_and_document_chunks_tables.sql | Implements complete PostgreSQL schema with tables, indexes, and constraints |
| SourceDocument.java | Core entity for document metadata with ingestion status tracking and business logic |
| DocumentChunk.java | Hierarchical chunk entity with parent-child relationships and tree navigation |
| SourceDocumentRepository.java | Repository with advanced queries for status filtering and duplicate prevention |
| DocumentChunkRepository.java | Repository with hierarchical navigation using PostgreSQL recursive CTEs |
| SourceDocumentTest.java | Unit tests for entity builder pattern and business logic validation |
| DocumentChunkTest.java | Unit tests for hierarchical relationships and tree structure methods |
| SourceDocumentRepositoryTest.java | Integration tests with TestContainers for repository operations |
| DocumentChunkRepositoryTest.java | Integration tests for hierarchical queries and cascade behavior |
| core/gradlew | Updated Gradle wrapper script with POSIX improvements |
| core/gradlew.bat | Updated Gradle wrapper batch script with merge conflict markers |
| @rem SPDX-License-Identifier: Apache-2.0 | ||
| @rem | ||
| ======= | ||
| >>>>>>> 2b49148 (build: regenerate gradle wrapper for consistent build environment) |
There was a problem hiding this comment.
Git merge conflict markers are present in the file. These should be resolved before merging.
Suggested change
| >>>>>>> 2b49148 (build: regenerate gradle wrapper for consistent build environment) | |
| @rem SPDX-License-Identifier: Apache-2.0 | |
| @rem |
| @rem SPDX-License-Identifier: Apache-2.0 | ||
| @rem | ||
| ======= | ||
| >>>>>>> 2b49148 (build: regenerate gradle wrapper for consistent build environment) |
There was a problem hiding this comment.
Git merge conflict markers are present in the file. These should be resolved before merging.
Suggested change
| >>>>>>> 2b49148 (build: regenerate gradle wrapper for consistent build environment) | |
| @rem SPDX-License-Identifier: Apache-2.0 | |
| @rem |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Key Implementation Notes
Major Components
Entity Layer
Repository Layer
Database Schema
Security Fixes
Package Structure Changes
Refactored to align with team standards from PR #5:
com.opencontext.entity.*- Entity classescom.opencontext.repository.*- Repository interfacesTest Coverage
All 28 tests pass with BUILD SUCCESSFUL:
Related Issues
Closes #4