Skip to content

Add Room database for Hebei Province university admission scores#1

Draft
Copilot wants to merge 10 commits intodevelopfrom
copilot/create-web-scraper-program
Draft

Add Room database for Hebei Province university admission scores#1
Copilot wants to merge 10 commits intodevelopfrom
copilot/create-web-scraper-program

Conversation

Copy link
Copy Markdown

Copilot AI commented Feb 18, 2026

Implements a Room-based database system to store and query university admission scores for Hebei Province's physics track (物理组) covering 2022-2024.

Database Schema

Three entities with foreign key relationships:

  • University - 10 Hebei institutions (including 211 Project schools), indexed on name
  • Major - Physics-related programs (计算机/软件/电子/自动化/机械), indexed on universityId
  • AdmissionScore - Score records with min/max/avg scores, provincial rankings, enrollment data, indexed on universityId/majorId/year

Implementation

DAOs with 39 specialized queries:

  • Query by year, province, subject group
  • Filter by score ranges, university type
  • Search majors by name pattern
  • Aggregate statistics across years

DatabaseHelper for async operations:

  • ExecutorService-based background execution
  • Main thread callbacks for UI integration
  • Seeded Random for reproducible sample data (145 records)
  • Proper enrollment calculation preventing negative values

AdmissionDetail immutable model:

  • Combines University + Major + AdmissionScore for join queries
  • Formatted Chinese output

Usage

DatabaseHelper helper = new DatabaseHelper(context);

// Insert sample data
helper.insertSampleData(callback);

// Query 2024 physics group scores
helper.getAdmissionDetailsByYear(2024, "河北", "物理组", 
    new DatabaseHelper.DatabaseCallback<List<AdmissionDetail>>() {
        public void onSuccess(List<AdmissionDetail> details) {
            // Process results on main thread
        }
    });

Notes

  • Room 2.6.1 (Java-only, no Kotlin dependencies)
  • Singleton pattern with thread-safe double-check locking
  • Fallback destructive migration for schema changes
  • CodeQL clean, no vulnerabilities

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • dl.google.com
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED -Xmx2048m -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en -Duser.variant -cp /home/REDACTED/.gradle/wrapper/dists/gradle-8.10.2-bin/a04bxjujx95o3nb99gddekhwo/gradle-8.10.2/lib/gradle-daemon-main-8.10.2.jar -javaagent:/home/REDACTED/.gradle/wrapper/dists/gradle-8.10.2-bin/a04bxjujx95o3nb99gddekhwo/gradle-8.10.2/lib/agents/gradle-instrumentation-agent-8.10.2.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 8.10.2 (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 5 commits February 18, 2026 14:43
Co-authored-by: Jiale-ui-dot <258919545+Jiale-ui-dot@users.noreply.github.com>
Co-authored-by: Jiale-ui-dot <258919545+Jiale-ui-dot@users.noreply.github.com>
Co-authored-by: Jiale-ui-dot <258919545+Jiale-ui-dot@users.noreply.github.com>
Co-authored-by: Jiale-ui-dot <258919545+Jiale-ui-dot@users.noreply.github.com>
Co-authored-by: Jiale-ui-dot <258919545+Jiale-ui-dot@users.noreply.github.com>
Copilot AI changed the title [WIP] Add web scraper program implementation Add web scraper utility for data extraction from web sources Feb 18, 2026
Copilot AI requested a review from Jiale-ui-dot February 18, 2026 14:50
Copilot AI and others added 4 commits February 18, 2026 14:57
Co-authored-by: Jiale-ui-dot <258919545+Jiale-ui-dot@users.noreply.github.com>
Co-authored-by: Jiale-ui-dot <258919545+Jiale-ui-dot@users.noreply.github.com>
… data generation

Co-authored-by: Jiale-ui-dot <258919545+Jiale-ui-dot@users.noreply.github.com>
Co-authored-by: Jiale-ui-dot <258919545+Jiale-ui-dot@users.noreply.github.com>
Copilot AI changed the title Add web scraper utility for data extraction from web sources Add Room database for Hebei Province university admission scores Feb 18, 2026
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