# JPA Inspired ORM from SQLite to PostgreSQL

DevFeed: [JPA Inspired ORM from SQLite to PostgreSQL](<https://devfeed.tech/articles/jpa-inspired-orm-from-sqlite-to-postgresql-60466.md>)

Original publisher: [Read original article](<https://www.codenameone.com/blog/orm-session-from-phone-to-server/>)

Author: Shai Almog

Published: 2026-09-27T00:00:00Z

Content type: tutorial

Language: en

Sources: [CodeName One](<https://devfeed.tech/sources/codename-one.md>)

Topics: [Object-relational mapping](<https://devfeed.tech/topics/orm.md>), [Hibernate](<https://devfeed.tech/topics/hibernate.md>), [SQLite](<https://devfeed.tech/topics/sqlite.md>), [PostgreSQL](<https://devfeed.tech/topics/postgresql.md>)

Tags: [backend](<https://devfeed.tech/tags/backend.md>), [client](<https://devfeed.tech/tags/client.md>), [hibernate](<https://devfeed.tech/tags/hibernate.md>), [java](<https://devfeed.tech/tags/java.md>), [jpa](<https://devfeed.tech/tags/jpa.md>), [locking](<https://devfeed.tech/tags/locking.md>), [mariadb](<https://devfeed.tech/tags/mariadb.md>), [mysql](<https://devfeed.tech/tags/mysql.md>), [optimistic-locking](<https://devfeed.tech/tags/optimistic-locking.md>), [orm](<https://devfeed.tech/tags/orm.md>), [postgresql](<https://devfeed.tech/tags/postgresql.md>), [queries](<https://devfeed.tech/tags/queries.md>), [relationships](<https://devfeed.tech/tags/relationships.md>), [sqlite](<https://devfeed.tech/tags/sqlite.md>)

## AI overview

This tutorial introduces managed ORM sessions for shared Java entities used on a client and backend. It explains relationship mappings, persistence and transactions, generated metadata, session behavior, and optimistic locking, with client-side SQLite and backend support for SQLite, PostgreSQL, MySQL, and MariaDB.

## Source excerpt

Use managed ORM sessions, relationships, lazy loading, JPQL queries, and optimistic locking with shared Java entities on the client and backend.