Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Strange Lob behavior

On Fri, Apr 12, 2013 at 6:58 AM, Laird Nelson <ljnelson@xxxxxxxxx> wrote:
On Fri, Apr 12, 2013 at 5:41 AM, Tom Ware <tom.ware@xxxxxxxxxx> wrote:
  Currently we do not convert LONGVARCHAR to a string type.


(Pressed Send too early.)

One other data point here that is a little odd.

My colleague tells me that the behavior is different depending on the query mechanism.

So if he does this:

em.createQuery("SELECT h.foo FROM Hork h"); // JPQL, not SQL; assume mappings are correct

...and "foo" is an Informix TEXT field where the driver classifies it as a java.sql.Types#LONGVARCHAR and returns a byte[] natively, he says he gets back a List<Object[]> (which I'd expect), but the zeroth (and only) element of the Object[] is (wait for it) the string representation of the data.

If he does this (the same stuff from my earlier emails):

em.createNativeQuery("SELECT foo FROM Hork"); // SQL, not JPQL

...then he gets back the hex representation of the byte array.

As I file my bug report: shouldn't these be the same?  Or is the former using JPA mapping information to help decide how to convert the result?  Isn't it a hole in the spec that the latter has no way to help the EntityManager out with the type of "foo"?

Best,
Laird

--
http://about.me/lairdnelson

Back to the top