openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Dick" <>
Subject Re: when is longvarchar used?
Date Thu, 02 Oct 2008 20:31:05 GMT
Hi David,

I'm not sure when longVarChar is used, I didn't see any hits in the code
(other than where the Dictionaries define it).

I can help with your second question. If you want to use TEXT instead of
VARCHAR for all entities in a PersistenceUnit you can add the following
property to persistence.xml :
  <property name="openjpa.jdbc.DBDictionary"
value="postgres(varcharTypeName=TEXT)" />

No need to write your own dictionary (although you could do that if you felt
like it). Nearly every attribute of the DBDictionaries can be overridden in
this way in case there are other things you'd like to change.

We'll have to take a look at the longVarChar issue though, maybe my quick
grep missed where it's used.


On Wed, Oct 1, 2008 at 9:20 AM, David Goodenough <> wrote:

> In the DB Dictionaries (in particular the one for Postgresql) there are
> two VARCHAR types, one longVarcharTypeName and the other
> varcharTypeName.  The first maps to TEXT and second to VARCHAR{0}.
> My question is, when it longVarchar used rather than varchar?
> In my setup I start from an Entity declaration (annotated) and I tell
> OpenJPA
> to generate the schema.  So I suppose my real question is what to I have to
> code (presumably an annotation) to get a longVarchar not a varchar.  I know
> I can map the DB column type explicitly, but would rather do it through the
> mapping if I can to maintain some vestige of DB transparency.
> Actually I would rather than for this application all String types were
> mapped
> to TEXT (i.e. longVarchar).  Can I provide a local DBDictionary extending
> the
> Postgresql one (how would I code it), and then how do I tell OpenJPA to use
> it.
> David

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