quality@glassfish.java.net

JPA problem with NB 7.1.1 GF 3.1.2

From: Michael Müller <michael.mueller_at_mueller-bruehl.de>
Date: Fri, 02 Mar 2012 18:14:53 +0100

Hi,

for a simple app I tried to use a JPA native query:

     public List<Category> getCategories(String languageCode){
         String sqlQuery = "select catId, isnull (ctName, catName) as
catName from listCategory left join listCategoryTrans on catId =
ctCategoryId and ctLanguage = ?1 order by catName;";
         return getEntityManager().createNativeQuery(sqlQuery,
Category.class).setParameter(1, languageCode).getResultList();
     }

This works perfect wit GF 3.1.1

But using GF 3.1.2 I'll get an error:

Caused by: Exception [EclipseLink-6044] (Eclipse Persistence Services -
2.3.2.v20111125-r10461): org.eclipse.persistence.exceptions.QueryException
Exception Description: The primary key read from the row [ArrayRecord(
      => 6
      => Datenbanken)] during the execution of the query was detected to
be null. Primary keys must not contain null.
Query: ReadAllQuery(referenceClass=Category sql="select catId, isnull
(ctName, catName) as catName from listCategory left join
listCategoryTrans on catId = ctCategoryId and ctLanguage = ? order by
catName;")

I double-checked: There is no null value.
The problem raised with NB 7.1.1 but I figured out, that it occurs only
with the new version of GF. I guess, it's not an NB but GF issue. Any
hint on that?

Best,
Michael