rzo1 opened a new pull request, #168:
URL: https://github.com/apache/openjpa/pull/168

   Note that the issue description is out of date: `getColumns()` no longer 
calls `getVersionFieldMapping()` and `initialize()` already validates the class 
mapping, both since e94a8515b, and both are already covered by tests. What 
remains is the surrogate case.
   
   `VersionVal.getType()` returned null for a type whose version is mapped by 
the version strategy rather than by a `@Version` field. `initialize()` admits 
such a type on purpose, since its version columns exist, so the null escaped 
into `JPQLExpressionBuilder` (`type.isPrimitive()` for `SELECT VERSION(e)`) and 
into `Filters.wrap` (for `WHERE VERSION(e) = :v`), both failing with a 
NullPointerException.
   
   `getType()` now falls back to `Object.class` — the same answer the in-memory 
`VersionVal` already gives, so the two query paths agree — and 
`toDataStoreValue()` converts through the version column's java type. Types 
with a real `@Version` field are unaffected.
   
   `initialize()` also reported an invalid `VERSION()` argument with the 
`bad-getobjectid` message, which describes an object id failure and whose 
argument is null for a bare identification variable. It now uses a dedicated 
message naming the path.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to