• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Generation & execution DDL schema

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, everyone! need help in the next issue:

there are 2 annotated classes :
first:


second:


I'm trying to generate a ddl schema using org.hibernate.tool.hbm2ddl.SchemaExport class, example :
example

first all turns fine - by maven I compile classes, then run through exec-maven-plugin main method SchemaGenerator and getting folowing schema:


As you can see at first is a record "alter table TRACK drop constraint FK4C5F92B15F7E587;" naturally when i trying to run this scheme by sql-maven-plugin occurs following:

1) when i execute only one goal such " mvn sql:execute " i'm getting :
---sql-maven-plugin:1.5:execute <default-cli> @ test3-proj --- 0 of 0 SQL statements executed successfully

No errors, but nothing happens and schema don't create tables

2)when join this goal to all build and execute " mvn package "

[ERROR] Failed to execute goal org.codehaus.mojo:sql-maven-plugin:1.5:execute (c
reate-database) on project test3-proj: user lacks privilege or object not found:
FK4C5F92B15F7E587 -> [Help 1]

If i delete first record in created schema alter table TRACK drop constraint FK4C5F92B15F7E587; with option 2) all works out fine!

So, are there any solutions on this? why SchemaGenerator class generates this unnecessary record ? how to get rid of it ?

thanks in advance



reply
    Bookmark Topic Watch Topic
  • New Topic