Entitymanager.createNativeQuery fieldnames

Is it possible to retrieve somehow the field names when using Entitymanager.createNativeQuery?

Is there a solution about this question ? I need to call a native query using getResultList method. I need to access to result list using column name and not index. How can I do it ?

At the moment i found the solution out of box :

DataSource dataSource = persistence.getDataSource();
Connection connection = dataSource.getConnection();
PreparedStatement pstmt = connection.prepareStatement(sql);
ResultSetMetaData meta = pstmt.getMetaData();
String colName = meta.getColumnName(idx);

Unfortunately, you can’t access result list fields using column name. JPA supports access only by index (EclipseLink/UserGuide/JPA/Basic JPA Development/Querying/Native - Eclipsepedia). Use directly JDBC API.