-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: hbm2ddl: jointable was not created.
PostPosted: Mon Jan 05, 2009 11:39 am 
Newbie

Joined: Thu Jun 10, 2004 9:34 am
Posts: 6
Hi to all,
I'm using hibernate3-maven-plugin 2.1 to generate my ddl. Actually the only thing that does not work properly is a join table of a many-to-many relationship. My code is

Code:
@Entity
@Table(name="t_match")
public class Match {
...
   @ManyToMany(targetEntity=SeasonTeamPlayer.class, cascade=CascadeType.ALL)
   @JoinTable(name="j_seasonteamplayer_match",
         joinColumns={@JoinColumn(name="match_id")},
         inverseJoinColumns={@JoinColumn(name="seasonteamplayer_id")})
   @ForeignKey(name="fk_a", inverseName="fk_b")
   public List<SeasonTeamPlayer> getPlayers() {
      return players;
   }
...
}

@Entity
@Indexed
@Table(name="t_seasonteamplayer")
public class SeasonTeamPlayer {
...
   @ManyToMany(cascade=CascadeType.ALL, mappedBy="players", targetEntity=Match.class)
   public List<Match> getMatches() {
      return matches;
   }
...
}


All other sql data are correctly generated, but this join table not. I looked reference docs and googled a lot without success. Probably I was missing something but I cannot be able to find what.

Any hint?

TIA,
Daniele

_________________
Daniele


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 06, 2009 10:41 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
no tables are generated at all ?

does it work if you use plain hbm.xml ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 08, 2009 6:13 am 
Newbie

Joined: Thu Jun 10, 2004 9:34 am
Posts: 6
All other tables, fk and index was correctly generated. BTW after a total clean of my ~/.m2/repository the problem seems to be solved, so I suspect a bugged maven plugin (seems too strange but no other idea).

Thank for all.
Daniele

_________________
Daniele


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.