Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Generation & execution DDL schema

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • 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



 
There are 29 Knuts in one Sickle, and 17 Sickles make up a Galleon. 42 tiny ads in a knut:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic