openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daryl Stultz <>
Subject left join fetch with long text fields
Date Thu, 05 Nov 2009 16:52:15 GMT

I have entity B with field "myLongText" defined like so:

@Column(name = "mylongtext", length = -1)
private String myLongText;

In PostgreSQL the column is a varchar(0).

When I retrieve a list of B entities, I get myLongText as expected, selected
in one query. Suppose I have entity A with bCol, a collection of B. If I
select like so:

select distinct o from A as o
left join fetch o.bCol

the value of myLongText is retrieved with an individual query PER B
instance! Naturally this is pretty slow. Is there some way to annotate this
field so it is always retrieved in the main query? Do I need to put a real
limit on it? What would that be?

I think somebody explored this problem recently but I can't remember any key
words from the discussion to search on.


Daryl Stultz
6 Degrees Software and Consulting, Inc.

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