Skip to content

Downgrade generated code to target Java 8 #9

Description

@nikita-volkov

Motivation

The upcoming pgenie-maven-plugin (source-injection model: generated sources are compiled as part of the consumer's own module) targets maximal consumer compatibility. Production JVM stats still show ~29% of applications on Java 8, disproportionately the DB-heavy enterprises pGenie targets. The generated code currently requires JDK 16+ (records), which caps the reachable market regardless of the plugin's own floor.

Scope

Rewrite the generation templates so the emitted code compiles under --release 8:

  • records → plain final classes (fields, constructor, accessors, equals/hashCode/toString)
  • text blocks (SQL literals) → string concatenation
  • any List.of / var / other post-8 idioms → Java 8 equivalents
  • generated pom.xml: maven.compiler.source/target = 1.8

Prerequisite

io.codemine.java.postgresql:jdbc (the single compile-scope dependency of generated code) must itself ship Java 8 bytecode. Track that downgrade in its own repo; this issue depends on it.

Acceptance

  • The demo project's generated output compiles with --release 8.
  • Generated integration tests still work on the chosen JUnit 5 / Testcontainers versions (both support Java 8).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions