Hi Laird

I forgot to add this bit, it *is* in the manual, but it's easier to find
once you know what you're looking for.

Link to the relevant section :
http://openjpa.apache.org/builds/latest/docs/manual/manual.html#ref_guide_mapping_jpa_constraints

It's something we can expand on though, maybe an example would help?

Hope this helps (assuming I've understood the question),

-mike

On Thu, Jul 9, 2009 at 1:32 PM, Michael Dick <[email protected]>wrote:

> I think you're looking for the org.apache.openjpa.persistence.jdbc.Index
> annotation :
> ex :
> import org.apache.openjpa.persistence.jdbc.Index;
>
> @Entity
> public class Person {
>     . . .
>     @Index
>     private int myint;
>     . . .
> }
>
> SQL generation (DB2) :
> 3786  laird  TRACE  [main] openjpa.jdbc.SQL - <t 9105104, conn 16916276>
> executing stmnt 17226426 CREATE TABLE Person (id INTEGER NOT NULL, firstName
> VARCHAR(254), lastName VARCHAR(254), myint INTEGER, version INTEGER, PRIMARY
> KEY (id))
> 3962  laird  TRACE  [main] openjpa.jdbc.SQL - <t 9105104, conn 16916276>
> [176 ms] spent
> 3971  laird  TRACE  [main] openjpa.jdbc.SQL - <t 9105104, conn 23361497>
> executing stmnt 17711949 CREATE INDEX I_PERSON_MYINT ON Person (myint)
>
> -mike
>
>
> On Thu, Jul 9, 2009 at 11:30 AM, Laird Nelson <[email protected]> wrote:
>
>> Is it possible to define a non-unique index in OpenJPA?  Hibernate offers
>> the @Index annotation to do this as part of its DDL generation machinery.
>>
>> My apologies if this was mentioned; I didn't see it in
>> http://openjpa.apache.org/builds/latest/docs/manual/manual.html.
>>
>> Thanks,
>> Laird
>>
>
>

Reply via email to