Skip to content

Add sample-java-entity-decorators project#1

Merged
iliyan-velichkov merged 2 commits into
masterfrom
add-sample-java-entity-decorators-project
May 19, 2026
Merged

Add sample-java-entity-decorators project#1
iliyan-velichkov merged 2 commits into
masterfrom
add-sample-java-entity-decorators-project

Conversation

@iliyan-velichkov
Copy link
Copy Markdown
Collaborator

Summary

  • Adds a Dirigible project under sample-java-entity-decorators/ demonstrating the engine-java + data-store-java annotation surface (@Entity, @Repository, @Controller, @Inject, @Get/@Post/@Delete, @PathParam, @Body, @Roles).
  • Adds a Java-oriented .gitignore and a README with the project layout and URL map.

Project layout

  • sample-java-entity-decorators/demo/Country.java@Entity
  • sample-java-entity-decorators/demo/CountryRepository.java@Repository extending JavaRepository<Country>
  • sample-java-entity-decorators/demo/CountryController.java@Controller with CRUD routes
  • sample-java-entity-decorators/demo/CountrySeeder.java@Controller that seeds three rows on POST
  • sample-java-entity-decorators/project.json

Controllers receive the repository via @Inject, which is the recommended client-code pattern (controllers never touch BeanProvider or JavaEntityStore directly).

Test plan

  • Drop the project into a Dirigible instance (clone via Git perspective, publish).
  • POST /services/java/sample-java-entity-decorators/demo/CountrySeederseeded.
  • GET /services/java/sample-java-entity-decorators/demo/CountryController/list → JSON list with Afghanistan/Albania/Algeria.
  • GET /services/java/sample-java-entity-decorators/demo/CountryController/1 → Afghanistan.
  • POST /services/java/sample-java-entity-decorators/demo/CountryController with JSON body → returns the inserted row.
  • DELETE /services/java/sample-java-entity-decorators/demo/CountryController/1 → 200, row gone from /list.
  • GET /services/openapi includes the controller paths.

🤖 Generated with Claude Code

iliyan-velichkov and others added 2 commits May 19, 2026 10:46
Adds a Dirigible project under sample-java-entity-decorators/ demonstrating
the engine-java + data-store-java annotation surface:

- demo/Country.java         — @entity persisted via the shared SessionFactory
- demo/CountryRepository.java — @repository extending JavaRepository<Country>
- demo/CountryController.java — @controller exposing CRUD over @Get/@Post/@delete
- demo/CountrySeeder.java   — @controller that seeds three rows on POST

CountryController and CountrySeeder receive the repository via @Inject, which
is the recommended client-code pattern (controllers never touch BeanProvider
or JavaEntityStore directly).

Also adds a Java-oriented .gitignore and fleshes out the README with the
project layout, URL map and a usage note.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Per integration-test review feedback, the seeder is folded into the test
itself (the test POSTs each country to CountryController) and the list
endpoint moves to the controller's bare base URL.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

1 participant