Bug 371850 - PostgreSQL with GenerationType.IDENTITY used SERIAL column type for Long id
Summary: PostgreSQL with GenerationType.IDENTITY used SERIAL column type for Long id
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P2 normal with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard: postgresql
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-17 02:39 EST by kyle shanahan CLA
Modified: 2022-06-09 10:03 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description kyle shanahan CLA 2012-02-17 02:39:18 EST
Build Identifier: 2.3.0.v20110604-r9504

i expected below code to create table which has BIGSERIAL column type id.

  @Entity
  public class NewEntity1 implements Serializable {
      private static final long serialVersionUID = 1L;
      @Id
      @GeneratedValue(strategy = GenerationType.IDENTITY)
      private Long id;
  ...

but it created:
  CREATE TABLE NEWENTITY1 (ID  SERIAL NOT NULL, PRIMARY KEY (ID))

it caused by PostgreSQLPlatform class which hardcoded "SERIAL" Identity column type. it should specify BIGSERIAL for Long id field. below:

  @Override
      public void printFieldIdentityClause(Writer writer) throws ValidationException {
          try {
              writer.write(" SERIAL");
          } catch (IOException ioException) {
              throw ValidationException.fileError(ioException);
          }
      }

a original question asked at stackoverflow:
  http://stackoverflow.com/questions/9284564/eclipselink-postgresql-doesnt-use-bigserial-to-long-id

Reproducible: Always

Steps to Reproduce:
1. create entity class which have Long Identity id.
2. create persistence.xml which includes "eclipselink.ddl-generation" property with "drop-and-create-tables" or "create-tables" value.
3. run the application.
Comment 1 Tom Ware CLA 2012-03-15 13:38:28 EDT
Setting target and priority.  See the following page for the meanings of these fields:

http://wiki.eclipse.org/EclipseLink/Development/Bugs/Guidelines

Community: Please vote for this bug if it is important to you.  Votes are one of the main criteria we use to determine which bugs to fix next.
Comment 2 Eclipse Webmaster CLA 2022-06-09 10:03:48 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink