0

I'm using javax.persistence.sql-load-script-source for my unit testing. Is there any standard way to put comments on the script?

The file contains insert statements for my entities.

INSERT INTO ... (...) VALUES (...) -- 1
INSERT INTO ... (...) VALUES (...) -- 2

I want to comment the generated id value for myself.

P.S. I'm using H2, Derby, and HSQLDB as in-memory databases and EclipseLink and Hibernate as JPA implementations.

Jin Kwon
  • 20,295
  • 14
  • 115
  • 184

1 Answers1

0

The implementation in EclipseLink ignores lines which are starting with an #. Comments at the end of line aren't currently supported, though.

You can have a look at it on Github:

// Remove trailing and leading white space characters.
String sqlString = sqlBuffer.toString().trim();

// If the string isn't empty, then fire it.
if ((! sqlString.equals("")) && (! sqlString.startsWith("#"))) {
Huntro
  • 322
  • 1
  • 3
  • 16