There is no way to do this that is ejb3-spec compliant, however, you can use some
hibernate extensions to accomplish this.
1. You need create an id genretor class that implements
org.hibernate.id.IdentifierGenerator implementing the generate method to return your
custom generated pk.
2. Annotate the primary key getter method for you ejb with the following
@Id
@Column(name = "ID")
@GeneratedValue(generator = "myCustomIDGen")
@GenericGenerator(name = "myCustomIDGen", strategy =
"full_classname_of_your_IdentifierGenerator_implementation")
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3971157#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...