[jboss-user] [JBoss Seam] - Re: Getting Id of Presisted object.

waheed.murad do-not-reply at jboss.com
Fri May 11 05:50:17 EDT 2007


This is how i have used oracle sequence.

sequenceName="CUSTOMER_SEQ":  Is the name is the name of your database sequence.

name="CUSTOMER_SEQUENCE":   U will use in Entity as i have used it with id field.


/////////////////////////////////

@Entity
@Name("Customer")
@Scope(EVENT)
@Table(name="Customer")
@SequenceGenerator(name="CUSTOMER_SEQUENCE", sequenceName="CUSTOMER_SEQ")
public class  ERegCustomer implements Serializable
{
	
   private Integer id;

@Id 
   @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="CUSTOMER_SEQUENCE")
   public Integer getId()
   {
      return id;
   }
   
   public void setId(Integer id)
   {
      this.id = id;
   }

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

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



More information about the jboss-user mailing list