openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Virag Kothari <vi...@yahoo-inc.com>
Subject Error: Query projections cannot include array, collection, or map fields
Date Tue, 30 Jul 2013 19:46:44 GMT
Hi All,

I am facing the following exception when having a blob (byte[]) as part of select statement.

Caused by: <openjpa-2.2.2-r422266:1468616 nonfatal user error> org.apache.openjpa.persistence.ArgumentException:
Query projections cannot include array, collection, or map fields.  Invalid query: "select
 a.lob1 from DummyBean a"

The following are the relevant parts of DummyBean:


@NamedQuery(name = "GET_LOB1", query = "select  a.lob1 from DummyBean a"),


    @Column(name = "lob1")

    @Lob

    private byte[] lob1 = null;



Is there a way to selectively retrieve just the byte[] (blob) columns? I know that "select
OBJECT(a) from …" would work.

Without using JPA, I can prepare the statement using java.sql.Statement and retrieve using
ResultSet.getByteArray(). What should I do to make it work with JPA?


Appreciate any help.


Thanks,

Virag








Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message