openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From MiƂosz Tylenda <mtyle...@o2.pl>
Subject Re: Help with Cassandra JPA plugin
Date Fri, 11 Mar 2011 21:05:33 GMT
Hi All,

More on the global sequence subject - you can define such a sequence in persistence.xml like
this:

<property name="openjpa.Sequence" value="com.datastax.hectorjpa.sequence.TimeUuid()"/>

Having this, you can annotate your entities with plain @GeneratedValue and your custom sequence
will be used.

As Kevin mentioned, OpenJPA does not call allocate(), however you can call it from the application:

        OpenJPAEntityManager kem = OpenJPAPersistence.cast(em);
        kem.getIdGenerator(TimeUuidEntity.class).allocate(100);

Cheers,
Milosz


Mime
View raw message