public String getDatabasePlatformClassName ( PUInfoImpl pui ) { SessionLog traceLogger = new TraceLog ( ) ; Properties properties = pui . getProperties ( ) ; String productName = properties . getProperty ( PersistenceUnitProperties . SCHEMA_DATABASE_PRODUCT_NAME ) ; String vendorNameAndVersion = null ; // check persistent properties if ( productName != null ) { vendorNameAndVersion = productName ; String majorVersion = properties . getProperty ( PersistenceUnitProperties . SCHEMA_DATABASE_MAJOR_VERSION ) ; if ( majorVersion != null ) { vendorNameAndVersion += majorVersion ; String minorVersion = properties . getProperty ( PersistenceUnitProperties . SCHEMA_DATABASE_MINOR_VERSION ) ; if ( minorVersion != null ) { vendorNameAndVersion += minorVersion ; } } } else { vendorNameAndVersion = getVendorNameAndVersion ( pui . getJtaDataSource ( ) ) ; if ( vendorNameAndVersion == null ) { getVendorNameAndVersion ( pui . getNonJtaDataSource ( ) ) ; } } return DBPlatformHelper . getDBPlatform ( vendorNameAndVersion , traceLogger ) ; }
Returns the EclipseLink database platform class name based on the properties passed in or by detecting it through the connection if one is available .