{
  "id": 10024246,
  "title": "One Java Model from the App to PostgreSQL",
  "url": "https://urgent.news/2026/09/26/one-java-model-from-the-app-to-postgresql",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-09-26T17:08:04.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/codenameone/one-java-model-from-the-app-to-postgresql-3oke"
  },
  "original_language": "en",
  "account": "The Codename One framework enables developers to create native iOS, Android, desktop, and web applications from a single Java or Kotlin codebase. This post demonstrates building a reminder service that follows a single model from Java code into the database. The backend is experimental but already includes generated routing, pooled connections, an ORM, and transactions.\n\nTo get started, use a Codename One Initializr project or add the backend module to an existing project. Run the necessary commands from the project root. The backend is activated using the -Dcodename1.platform=backend flag to avoid entering an ordinary client build.\n\nCreate the Reminder.java model class with two fields: id (long) and title (String). Apply the com.codename1.annotations.Column, Entity, and Id annotations to specify the table name and field properties. Next, create the ReminderRules.java class that contains a static method for validating and formatting the title field according to Codename One's rules.\n\nFinally, implement a controller (ReminderController.java) that communicates with the ORM to perform CRUD operations on the Reminder entity. Use @RestController, @RequestMapping, @GetMapping, and @PostMapping annotations to describe the controller and its routes. Inject the EntityManager into the controller's constructor and use DAO methods to interact with the database. This API follows familiar Spring conventions, making it easy for developers to understand and work with.",
  "summary": "The annoying part of full stack development is finding the same rule in three places. The app checks a field, the server checks it slightly differently, and the database model has another idea about what it should contain. What is Codename One? Codename One is an open-source framework for building native iOS, Android, desktop, and web apps from a single Java or Kotlin codebase. Learn more at…",
  "key_points": [
    "Codename One framework enables cross-platform app development from a single Java/Kotlin codebase.",
    "Reminder service demonstrates building a single model from Java code into PostgreSQL database.",
    "ReminderController implements CRUD operations using Spring conventions with EntityManager."
  ],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}