1 Reply Latest reply on Apr 29, 2011 6:02 AM by Dmitry Geraskov

    JPA Tools & generate  tables from entities

    Eric J. Van der Velden Newbie

      Hello

       

      I create a JPA project and do

      New-> Entity

       

      It is a class type M with a @Entity and one field, id with a @Id.

       

      There is a error message: table "M" cannot be resolved. I understand that, because this table is not there yet.

       

      I do

      JPA Tools-> Generate Tables from Entities...

       

      I check "Export to database". The result is that schema.ddl is generated but no table M in the database appears (Q1).

       

      So I decided to do it by hand. But in the editor I see that the 'Connection profile' just above schema.ddl is not filled in (Q2). I fill it in by chosing my database connection's name and select the ddl in schema.ddl and execute it. Now my table M is there, which I see by selecting my schema in the 'Data Source Explorer' view, and refresh it. I have to do this anyway because now I can clean my JPA project and the error message: table "M" cannot be resolved, will disappear. 

       

      So my questions are: (Q1) why is table M not created? and  (Q2) why is 'Connection profile' not filled in. Or is it the intention of JBoss Tools that I create the table by hand by right clicking in  schema.ddl?

       

      Thanks,

       

      Eric J.