Hi,
OpenJPA does assign special meaning to '0' value for primary key. For
example, one such special meaning is when an instance X is being merged and
does not have a version field, if primary key value of X is 0, then X is
assumed to be new, otherwise X is considered as an update.
Beyer,Nathan wrote:
>
> I'm trying to write a bit of code that's portable between JPA providers
> and ran into a few differences and I'd like to know if they are undefined
> bits of the spec or just me doing something silly.
>
> 1. 0 is considered null for primary key fields (@Id) of type int, long -
> OpenJPA DOES NOT do this, but other providers, such as EclipseLink do. Is
> this in the spec or up for debate?
>
> 2. Return value of native queries is an Object[] or a List - Consider the
> following snippets
>
> // LOG is table name with a 'sequence' column/field of Java
> type 'long'
> final Query query = entityManager.createNativeQuery("SELECT
> MIN(e.sequence), MAX(e.sequence) FROM LOG e");
> final Object result = query.getSingleResult();
>
> With OpenJPA a Object[] is returned, in EclipseLink a List is
> returned.
> Is this defined anywhere? How can I define it.
>
>
> Thanks,
> -Nathan
>
> ----------------------------------------------------------------------
> CONFIDENTIALITY NOTICE This message and any included attachments are from
> Cerner Corporation and are intended only for the addressee. The
> information contained in this message is confidential and may constitute
> inside or non-public information under international, federal, or state
> securities laws. Unauthorized forwarding, printing, copying, distribution,
> or use of such information is strictly prohibited and may be unlawful. If
> you are not the addressee, please promptly delete this message and notify
> the sender of the delivery error by e-mail or you may call Cerner's
> corporate offices in Kansas City, Missouri, U.S.A at (+1) (816)221-1024.
>
--
View this message in context:
http://n2.nabble.com/what-to-expect---jpa-spec-or-impl-discretion-tp575285p575460.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.