[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - JoinColumn annotation order

rajuanye do-not-reply at jboss.com
Thu Sep 14 04:03:27 EDT 2006


Hi all :)
I have been using  ManyToMany annotation to connect two tables.

I thought the order of 'JoinColumn', does not matter, however when I wrote:

@ManyToMany(cascade = {CascadeType.PERSIST, CascadeType.MERGE}, fetch=FetchType.LAZY)
   @JoinTable(name="profile_group_link"
            ,  inverseJoinColumns = {@JoinColumn(name = "group_id")},
            joinColumns = { @JoinColumn(name = "profile_id"), at JoinColumn(name = "population_id")})

It did not work ,so I changed the order:
 joinColumns = {@JoinColumn(name = "population_id"), @JoinColumn(name = "profile_id")})

and it worked perfect!!!

Does any one knows why that happens?

Do the order of the annotation change things?

thanks
Very confused individual



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

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



More information about the jboss-user mailing list