Package com.codename1.orm.session


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.