anonymous wrote : I tried using OneToMany annotation along with nullable set to 
true, but that doesn't work. 
Associations are "optional" by default.
To enforce 1..* or 1..1 associations, you'd have to do:
@ManyToOne(optional = false)

What exactly isn't working? Are you using the "mappedBy" property correctly?

Example:

  | @Entity
  | public class A {
  | ...
  | @OneToMany(mappedBy = "myA")
  | public List<B> getBList() {
  |   return bList;
  | }
  | ...
  | }
  | 
  | @Entity
  | public class B {
  | ...
  | @ManyToOne
  | public A getMyA() {
  |   return myA;
  | }
  | ...
  | }
  | 

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

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3984235
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to