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 AttributeConverter | Reflection-free conversion between a domain value and one SQL scalar. |
class Identifier | Immutable composite identity, in the model’s declared identifier-field order. |
interface JpqlQuery | A mutable query obtained from Session.createQuery(String, Class). |
class LazyInitializationException | An unloaded association was accessed after its session was detached or closed. |
enum LockMode | Explicit row-lock modes. |
class OptimisticLockException | The row was changed or removed since it was loaded. |
class PersistenceException | An ORM failure, including an underlying database failure during lazy access. |
interface Query | A mutable, parameterized query obtained from Session.query(Class). |
interface Session | A persistence context obtained from an entity manager’s openSession() method. |