[jboss-user] [JBoss Seam] - Re: Inserting into primary and secondry table using bean

kaviarasu do-not-reply at jboss.com
Thu Aug 2 03:33:58 EDT 2007


hi i cant able to understand ur schema 
i have pasted the sample coding 
can u say how to insert in this, i created two tables Table 1 and table 2. this code is generated by exadel

@Entity
  | public class Table1 implements Serializable {
  | 	@Id
  | 	private BigDecimal no;
  | 
  | 	@OneToMany(mappedBy="no")
  | 	private Set<Table2> table2Collection;
  | 
  | 	private static final long serialVersionUID = 1L;
  | 
  | 	public Table1() {
  | 		super();
  | 	}
  | 
  | 	public BigDecimal getNo() {
  | 		return this.no;
  | 	}
  | 
  | 	public void setNo(BigDecimal no) {
  | 		this.no = no;
  | 	}
  | 
  | 	public Set<Table2> getTable2Collection() {
  | 		return this.table2Collection;
  | 	}
  | 
  | 	public void setTable2Collection(Set<Table2> table2Collection) {
  | 		this.table2Collection = table2Collection;
  | 	}
  | 
  | }



Table 2 


@Entity
  | public class Table2 implements Serializable {
  | 	@Id
  | 	private BigDecimal eno;
  | 
  | 	@ManyToOne
  | 	@JoinColumn(name="NO")
  | 	private Table1 no;
  | 
  | 	private static final long serialVersionUID = 1L;
  | 
  | 	public Table2() {
  | 		super();
  | 	}
  | 
  | 	public BigDecimal getEno() {
  | 		return this.eno;
  | 	}
  | 
  | 	public void setEno(BigDecimal eno) {
  | 		this.eno = eno;
  | 	}
  | 
  | 	public Table1 getNo() {
  | 		return this.no;
  | 	}
  | 
  | 	public void setNo(Table1 no) {
  | 		this.no = no;
  | 	}
  | 
  | }

thank you 
ragrds 
kaviarasu

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

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



More information about the jboss-user mailing list