Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Dali » Missing join table in database using JPA Tools -> Generate Tables from Entities(Difficulties with Generate Tables from Entities)
Missing join table in database using JPA Tools -> Generate Tables from Entities [message #1017159] Sun, 10 March 2013 05:47 Go to next message
G M is currently offline G M
Messages: 2
Registered: March 2013
Junior Member
I'm learning (Eclipse + WTP/Dali + JPA Diagram Editor) and defined a 1:n relationship in the DiagramEditor between Department and Person entity.

The resulting code for "Department" entity is:

	@OneToMany(mappedBy = "department", cascade = ALL)
	private Set<Person> person;


JPA Details view shows: Joining strategy = "Join table" >> Name = "Default (t_department_t_person)" and the Join & Inverse columns are properly identified.

When I run "JPA Tools" >> "Generate Tables from Entities..." (MySQL db), the join table is not created (all other tables are fine) and the Validation in Eclipse is identifying the error "Join table 't_department_t_person' cannot be resolved" since it is not in the db.

I'm using: Juno with latest version of WTP (installed today), mysql-connector 5.1.23

If anyone could kindly point out what I'm missing?

Thank you!
Re: Missing join table in database using JPA Tools -> Generate Tables from Entities [message #1017803 is a reply to message #1017159] Tue, 12 March 2013 15:07 Go to previous messageGo to next message
Neil Hauge is currently offline Neil Hauge
Messages: 469
Registered: July 2009
Senior Member
Hi,

Something looks odd with your example. You have a One to Many with a mappedBy specified, but you are saying that in the details the Joining Strategy is Join Table, which is the default (if you didn't have mappedBy specified). The strategy should be showing as mappedBy.

Can you send a larger example of the entity code? It would help to identify what the table generator should be doing.

Neil
Re: Missing join table in database using JPA Tools -> Generate Tables from Entities [message #1018036 is a reply to message #1017803] Wed, 13 March 2013 02:03 Go to previous message
G M is currently offline G M
Messages: 2
Registered: March 2013
Junior Member
Mea Culpa! I must have done something wrong.

Based on your kind feedback I went back and started a new project from scratch - and this time everything came out as expected.

I don't even want to speculate how I ended up with that setting...

I appreciate you taking the time!
Previous Topic:Reverse engineering - Problem with char columns
Next Topic:Hibernate to JPA 2.0 migration issues
Goto Forum:
  


Current Time: Fri Oct 24 20:37:32 GMT 2014

Powered by FUDForum. Page generated in 0.01565 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software