[jboss-user] [EJB 3.0] - Re: Problem using SequenceGenerator

bryan_castillo do-not-reply at jboss.com
Thu Jul 27 13:56:22 EDT 2006


I found some documentation showing how to override the generator, by using hibernate specific annotations.

	@Id
  | 	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="VNDR_ID_SEQ")
  | 	@GenericGenerator(name="VNDR_ID_SEQ", strategy="org.hibernate.id.SequenceGenerator",
  | 	    parameters={
  | 	        @Parameter(name="sequence", value="VRAP.VNDR_ID_SEQ")
  | 	    }
  | 	)
  | 	//@SequenceGenerator(name="VNDR_ID_SEQ", sequenceName="VRAP.VNDR_ID_SEQ")
  | 	@Column(name="VNDR_ID")
  | 	public int getId() {
  | 		return id;
  | 	}


I have these imports for the hibernate annotations.

import org.hibernate.annotations.GenericGenerator;
  | import org.hibernate.annotations.Parameter;

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3961377#3961377

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3961377



More information about the jboss-user mailing list