Cannot create jpa tables in eclipse

I had a working project in eclipse that created a JPA table from an entity into a mysql database (still learning). Unfortunately, he made a table in the wrong database, since I wanted the "test" and "production" databases there. Somehow, he got the details for the "production" db, even if it looked as if the selected database connection was for the test. I faked the project a bit and connected it to the correct connection object for a specific (test). I can ping db in eclipse (both dbs) and see db in the data source explorer. But now I can’t create a table for the project by right-clicking it and choosing JPA Tools> Generate Tables From Objects. Creation starts and ends without errors, like everythingbut I do not see tables in any of the databases. (In eclipse Database explorer or from the command line). The persistence.xml file must be accurate as it already created this table before.

The only mistake for the Entity class is because it says for the Entity annotation: "Table xxx cannot be resolved." And, as I see it, this is due to the fact that the table is not created.

Here's persistence.xml just in case. http://pastebin.com/djPZei90

The project is also a Maven project and uses SVN. Dependencies were successfully uploaded by maven for the eclipse / project, and there are no complications with SVN.

Because of Maven, there are 2 persistence.xml files (only login credentials and database name change) for production and testing. It is possible that the db connection was checked and downloaded from the wrong file in 1st place. (just guessing)

Also I tried to create script.sql when creating the table (s). I found the file, but it was completely empty.

, . . , , ?

+3
3

, . , , , (2 'persistence.xml', maven), , , , . , ( persitence.xml). , . eclipselink, :

    <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>

, .

+2

? , , . JPA Tools - , persistence.xml.

, f **. , . , /, . eclipse 4.2.0. .

: Dali Tools, JPA Configurator, Seam 3. , , , , , , . Eclipse ...

+1

.

(JPA) Eclipse (Indigo btw). (mysql).

Eclipse. > > ... > .

Eclipse "persistence.xml" (src/META-INF/persistence.xml).

"JPA Entity" eclipse. ( "id" (PK) "" ) 'pom.xml' ( , ).

'persistence.xml' (src/main/java/META-INF/, no 'test'). .

" Maven" eclipse ( a > Configure) Maven "persistence.xml" , . (Mavenizing pom.xml)

( , ...).

> Maven > Maven

maven, > > ...

. !

!

, , . , - maven (plugin) + eclipse.

. ( ). <class> 'persistence.xml', . ( maven)

- / - . , , , , , , .

0

All Articles