persistence@glassfish.java.net

specifying sequence starting number in DescriptorCustomizer

From: sud <to_sud_at_yahoo.com>
Date: Sun, 21 Oct 2007 18:17:32 -0700 (PDT)

When using the following workaround for GeneratedValue on a non-id field, is it possible to specify the starting number in the sequence? [Quote] As a workaround you can enable this using the TopLink Essentials descriptor API. Specify a DescriptorCustomizer in your persistence.xml. public class MyDescriptorCustomizer implements DescriptorCustomizer { public void customize(ClassDescriptor descriptor) { descriptor.setSequenceNumberName("OWNER_SEQ"); descriptor.setSequenceNumberFieldName("number"); } } [Quote] __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com