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
|