proomt

Search

Search posts, papers, and topics

All posts

CodeName OneShai Almog7 min readintermediate

One Java Model from the App to PostgreSQL

Summary

Codename One introduces a backend runtime allowing a single Java model to define entities and validation rules for both client applications and the server. This approach aims to reduce duplication and ensure consistent data rules from the app to PostgreSQL.

  • A single Java `@Entity` class defines the data model for both client-side ORM (SQLite) and server-side ORM (PostgreSQL, MySQL).
  • Shared static validation methods ensure consistent data integrity checks on both client and server.
  • The backend uses Spring-like annotations (`@RestController`, `@RequestMapping`) for API definition, with generated routing.
  • The ORM supports multiple databases (SQLite, Postgres, MySQL) via configuration, using native wire protocols for server-side.

Developers building full-stack Java applications can benefit from this approach by centralizing data models and validation logic, reducing boilerplate and potential inconsistencies across client and server.

6/10

Related reading

  1. SQLite Across Every Port: One Contract, One Encrypted File Format

    Codename One now ships a single, tested SQLite contract that works natively on Android, iOS, Windows, Linux, and in browsers via WebAssembly, with built‑in SQLCipher‑4 encryption supporting three key models. A conformance suite guarantees identical behavior across platforms, and migration helpers let legacy apps opt‑in. The update also adds a proper watch‑app model, DOM‑based text for JavaScript,…

    CodeName Onecodenameone.com11 min
  2. Article: Your Next DSL Author Is a Language Model

    Typed Domain Grounding (TDG) embeds a DSL inside a mainstream language the LLM already knows (e.g., Kotlin) and uses the host compiler as an oracle. The author describes five building blocks—embedding, choosing a host language with high training‑data frequency, compiler‑driven type safety, a generate‑compile‑repair loop, and an on‑demand teaching tool—and shows measured results from kUML, a Kotli…

    InfoQinfoq.com18 min
  3. The architecture of Neki

    Neki is PlanetScale’s sharding layer for vanilla PostgreSQL that presents a single Postgres endpoint while routing queries across a fleet of Postgres instances. It does this with a set of tightly‑coupled components—Router, Sidecar, PostgresManager, Admin, Operator, and etcd‑backed Data Topology—each handling a specific piece of the scaling, failover, and query‑planning puzzle.

    PlanetScaleplanetscale.com8 min