I use ebean with play 2.0.1 so I don' want to switch the ebean version
or used a patched one. Instead I'll use javassist to replace the
UuidIdGenerator.nextId() method with my own implementation on
application startup.
If I find time I will also implement it for ebean so there is no need
for javassist.
Thanks for your help!
Cheers, Heinrich
On 8 Mai, 13:39, Rob Bygrave <
robin.bygr...@gmail.com> wrote:
> The database platform is more for DB Identity and DB Sequence's.
>
> So not sure if you are using this ...
https://github.com/cowtowncoder/java-uuid-generator/blob/3.0/src/test...
>
> If the UUID generator generates java.util.UUID and you use the
> java.util.UUID type in your domain objects then I'd say the best approach
> is to get Ebean to allow pluggable implementations of the UUID generation.
> Ebean already automatically assigns its UUIDGenerator to domain objects
> whose Id field is of type java.util.UUID.
>
> @Id UUID id;
>
> ... so if this was your case then you just need to swap out the default
> implementation with your own (enhance Ebean to allow a pluggable
> UUIDGenerator implementation).
>
> If instead you use a String type for your id rather than java.util.UUID ...
> then Ebean should add a @UUID annotation (there is an existing enhancement
> request to do this) so it would look like:
>
> @UUID @Id String id;
>
> If you want to use some type other than String or java.util.UUID then more
> thinking is required probably.
>
> Cheers, Rob.
>