users@glassfish.java.net

Re: EJB 3.0, Customized Id

From: Mitesh Meswani <Mitesh.Meswani_at_Sun.COM>
Date: Thu, 10 Apr 2008 17:09:49 -0700

There is no portable approach available in current JPA spec to
accomplish this.

glassfish_at_javadesktop.org wrote:
> Hi,
>
> I want to generate unique id in the database. This can be done easily by using
>
> @Id
> @GeneratedValue(strategy = GenerationType.AUTO)
> public String getId() {
> return id;
> }
>
> However, if I want to enforce that each Id must start with a particularprefix,
> then how do I do this. I have tried to search on the web no information is
> available.
>
> cheers, gceman
> [Message sent by forum member 'gceman' (gceman)]
>
> http://forums.java.net/jive/thread.jspa?messageID=268659
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>