EclipseLink is fully support JPA 2, this documents use EclipseLink as example, diving into the Process of JPA EntityManager initiation, we mainly focus on the below figure:
Returns the ServerSession that the Factory will be using and initializes it if it is not available.
This class handles deployment of a persistence unit.
In predeploy the meta-data is processed and weaver transformer is returned to allow weaving of the persistent classes.
In deploy the project and session are initialize and registered.
the call to setupImpl.deploy() finishes the session creation
- new TestMySQLPlatform()
This is database platform come from persistence.xml.
Each ServerSession hold a DatasourceLogin, set Platform to DatasourceLogin if we have condifured one via persistence.xml.
This will setup database connection pool for both write and read.
Generate the DDL using the correct connection.
eclipselink.ddl-generation is the threshold used to enable DDL Generation, for example, drop-and-create-tables.
The DefaultTableGenerator is a utility class used to generate a default table schema, it hold a DatabasePlatform which initialized in updateLogins().