quality@glassfish.java.net

_at_GeneratedValue(strategy = GenerationType.AUTO)

From: Adam Bien <abien_at_adam-bien.com>
Date: Tue, 02 Sep 2008 12:29:11 +0200

Hi all,

@GeneratedValue(strategy = GenerationType.AUTO) does not work as with GF
v2.

GFV2 / TopLink essentials, would create a sequence for you. GF v3 fails
with the following error:

Caused by: java.sql.SQLSyntaxErrorException: Die Tabelle/Ansicht
'SEQUENCE' ist nicht vorhanden.
    at
org.apache.derby.client.am.SQLExceptionFactory40.getSQLException(Unknown
Source)
    at org.apache.derby.client.am.SqlException.getSQLException(Unknown
Source)
    at org.apache.derby.client.am.Connection.prepareStatement(Unknown
Source)
    at
com.sun.gjc.spi.base.ConnectionHolder.prepareStatement(ConnectionHolder.java:475)
    at
org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.prepareStatement(DatabaseAccessor.java:1340)
    at
org.eclipse.persistence.internal.databaseaccess.DatabaseCall.prepareStatement(DatabaseCall.java:648)
    at
org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:550)
    ... 74 more
Caused by: org.apache.derby.client.am.SqlException: Die Tabelle/Ansicht
'SEQUENCE' ist nicht vorhanden.
    at org.apache.derby.client.am.Statement.completeSqlca(Unknown Source)
    at
org.apache.derby.client.net.NetStatementReply.parsePrepareError(Unknown
Source)
    at
org.apache.derby.client.net.NetStatementReply.parsePRPSQLSTTreply(Unknown
Source)
    at
org.apache.derby.client.net.NetStatementReply.readPrepareDescribeOutput(Unknown
Source)
    at
org.apache.derby.client.net.StatementReply.readPrepareDescribeOutput(Unknown
Source)
    at
org.apache.derby.client.net.NetStatement.readPrepareDescribeOutput_(Unknown
Source)
    at
org.apache.derby.client.am.Statement.readPrepareDescribeOutput(Unknown
Source)
    at
org.apache.derby.client.am.PreparedStatement.readPrepareDescribeInputOutput(Unknown
Source)
    at
org.apache.derby.client.am.PreparedStatement.flowPrepareDescribeInputOutput(Unknown
Source)
    at org.apache.derby.client.am.PreparedStatement.prepare(Unknown Source)
    at org.apache.derby.client.am.Connection.prepareStatementX(Unknown
Source)


is it a bug or feature?

The persistence.xml is:

  <persistence-unit name="book" transaction-type="JTA">
    <jta-data-source>jdbc/sample</jta-data-source>
    <properties>
      <property name="eclipselink.ddl-generation"
value="drop-and-create-tables"/>
    </properties>
  </persistence-unit>
</persistence>


GF v3 should behave in this area identically to GF v2 - just think of
migration projects...

regards,

adam