[jboss-user] [JBoss Seam] - Re: Inserting into primary and secondry table using bean
trickyvail
do-not-reply at jboss.com
Mon Jul 30 11:23:02 EDT 2007
This is a question for the EJB3 forum.
Yes this is easy to do without using a trigger.
You could map as a One-to-One Unidirectional or a One-to-One Bidirectional.
e.g. One-to-One Unidirectional
| @Entity
| public class Employee
| {
| private int id;
| private Address address;
|
| @Id
| @Column(name = "eno")
| @GeneratedValue
| public int getId() { return this.id; }
|
| @OneToOne
| @PrimaryKeyJoinColumn
| public Address getAddress() { return address; }
|
| }
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4068779#4068779
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4068779
More information about the jboss-user
mailing list