package com.codename1.orm.session

Managed persistence contexts and queries for the client and backend ORMs.

Open a Session with the runtime’s EntityManager.openSession() method. A session maintains entity identity, detects changes, and loads relationships using metadata generated at build time. Writes require an active transaction; closing a session rolls back an active transaction and detaches its entities. Sessions are not thread-safe. Initialize associations needed by the UI before detaching entities, and perform client database access off the event thread.

Use Query for builder queries or JpqlQuery for the documented JPQL subset. Models and relationship field access are generated and enhanced at build time.

Types

interface AttributeConverterReflection-free conversion between a domain value and one SQL scalar.
class IdentifierImmutable composite identity, in the model’s declared identifier-field order.
interface JpqlQueryA mutable query obtained from Session.createQuery(String, Class).
class LazyInitializationExceptionAn unloaded association was accessed after its session was detached or closed.
enum LockModeExplicit row-lock modes.
class OptimisticLockExceptionThe row was changed or removed since it was loaded.
class PersistenceExceptionAn ORM failure, including an underlying database failure during lazy access.
interface QueryA mutable, parameterized query obtained from Session.query(Class).
interface SessionA persistence context obtained from an entity manager’s openSession() method.