JPA2, entityManager.unwrap(Connection.class) JDBC.
:
Connection connection = entityManager.unwrap( Connection.class );
try (Statement stmt = connection.createStatement()) {
stmt.executeUpdate( "INSERT INTO MyTable( name ) VALUES ( 'my name' ) " );
}
, JDBC EJB 3? JPA, ORM. SQL.
This was once necessary for performance or compatibility issues. I usually use this method to execute PL / PSQL with array parameters, complex Posgis SQL, etc.
source
share