This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 236581 - Missing semicolons in the generated db script for Derby
Summary: Missing semicolons in the generated db script for Derby
Status: RESOLVED WONTFIX
Alias: None
Product: javaee
Classification: Unclassified
Component: Persistence (show other bugs)
Version: 8.0
Hardware: All All
: P3 normal (vote)
Assignee: Sergey Petrov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-01 06:41 UTC by Petr Jiricka
Modified: 2014-07-22 13:53 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Jiricka 2013-10-01 06:41:41 UTC
1. Create a Java EE 7 web project
2. Generate entities from database in this project using the sample db
3. Generate new DB script from these entities
4. Create a new Derby database in NetBeans
5. Execute the generated script against the new database

=> Command execution fails with:
Error code -1, SQL state 42X01: Syntax error: Encountered "CREATE" at line 2, column 1.
Line 1, column 1

Execution finished after 0 s, 1 error(s) occurred.


You need to add semicolons at the end of each line to make it work. The IDE should do that automatically.
Comment 1 Sergey Petrov 2013-10-01 07:26:04 UTC
may it be considered as eclipselink issue? is there any use case when generation of sql script without semilolons may be applied.
Comment 2 Sergey Petrov 2014-01-14 14:53:49 UTC
I would like to cloase as won't fix,
I can't find any api either in jpa spec or eclipselink specific to specify separator between sql commands, if jpa spec/eclipselink doesn't care and itself generate script this way, it just works this way.

also tried to add 
                props.put("javax.persistence.database-product-name", dbconn.getJDBCConnection().getMetaData().getDatabaseProductName());
                props.put("javax.persistence.database-product-version", dbconn.getJDBCConnection().getMetaData().getDatabaseProductVersion());

to properties passed to persistence generator and it doesn't matter, commnds are just placed on each line separately
Comment 3 Sergey Petrov 2014-07-22 13:53:03 UTC
according to above comment