//java code如下
TypedQuery<?> outputSql = entityManager.createQuery(query);
org.eclipse.persistence.sessions.Session session = communityEm.unwrap(org.eclipse.persistence.jpa.JpaEntityManager.class).getActiveSession();
org.eclipse.persistence.queries.DatabaseQuery databaseQuery = outputSql.unwrap(org.eclipse.persistence.jpa.JpaQuery.class).getDatabaseQuery();
databaseQuery.prepareCall(session, new org.eclipse.persistence.sessions.DatabaseRecord());
System.out.println("databaseQuery.getSQLString()"+databaseQuery.getSQLString());