users@glassfish.java.net

EJB 3.0, Customized Id

From: <glassfish_at_javadesktop.org>
Date: Thu, 10 Apr 2008 17:19:29 PDT

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