Skip to content

Latest commit

 

History

History
54 lines (35 loc) · 3.25 KB

File metadata and controls

54 lines (35 loc) · 3.25 KB

Datastore module

The datastore Maven project (datastore/pom.xml) is an integration and example layer: it contains hand-written tests that exercise generated persistence code (typically DataManager, *Store, and model types). It is not the same artifact as core or compiler; it does not implement the crawler or templates itself.

For Maven reactor notes (this module is not in the parent <modules> list), see Project structure.

Artifact coordinates

  • groupId: org.example
  • artifactId: datastore
  • version: aligned with parent (1.0-SNAPSHOT)

The generated code used in tests is configured to live under the org.example Java package (see compiler tests’ rootPackage in CompilerTestUtil).

Source layout

Path Role
datastore/src/main/java/ Target for generated sources. Often empty until you run Application.compile(new JavaCompiler()) with srcFolder pointing here.
datastore/src/test/java/org/example/ Hand-written tests: store/*StoreTest.java, repository/, storedprocedure/, util/ (DataSourceProvider, EncryptionUtil, …).

Tests import generated types such as DataManager, AccountsStore, and Accounts from org.example after generation; see for example AccountsStoreTest.

Typical workflow

  1. Start a database (for example docker compose up -d using root docker-compose.yml — PostgreSQL on port 5432 with moviedb / scripts under init.db/postgres).

  2. Ensure database.properties matches your JDBC URL, user, password, and schema.

  3. Run code generation so datastore/src/main/java contains org.example sources (for example run compiler module tests, or a small main that calls application.compile(new JavaCompiler())).

  4. Run datastore tests:

    mvn -f datastore/pom.xml clean test

Because datastore is outside the default reactor, mvn clean install from the repository root does not compile or test this module unless you add it to the parent POM or invoke it with -f as above.

Dependencies (datastore/pom.xml)

  • PostgreSQL JDBC driver — Runtime database access for tests.
  • Spring Data Commons — Used by tests (for example paging/specification-style helpers where applicable).

There is no direct Maven dependency from datastore onto core or compiler; the link is conceptual: generated code is expected to be compatible with the JDBC stack you use at test time.

JDK note

  • The parent and datastore POMs declare Java 17 for compilation.
  • The root README.md mentions broader JDK support historically (minimum 11, tested up to 18). Treat the POM as the authoritative build level for this tree; use README for informal compatibility notes.

Related documentation