facebook

Difficulty with JPA RevEng + Postgres + BIGSERIAL

  1. MyEclipse Archived
  2.  > 
  3. Database Tools (DB Explorer, Hibernate, etc.)
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #289696 Reply

    kbowen42
    Member

    I’m having difficulty with JPA and BIGSERIAL id’s under PostgreSQL.
    I’m using Eclipse Version: 6.0.1 GA over PostgreSQL 8.3.1 on MacOS/X 10.5.4.
    I’m applying JPA Reverse Engineering to a database containing table definitions like this:

    CREATE TABLE address
    (
    addressId BIGSERIAL NOT NULL,
    accountId BIGINT NOT NULL,
    street1 VARCHAR(256) NULL,
    … other fields…
    PRIMARY KEY (addressId),
    FOREIGN KEY (accountId) REFERENCES account(accountId)
    );

    I’m generating abstract classes.
    My jpa.reveng.xml contains:

    <table name=”address” catalog=”public”>
    <primary-key>
    <generator class=”native” />
    <column name=”addressId” />
    </primary-key>
    </table>

    However, the id getter in AbstractAddress.java only contains the following annotations:


    @Id

    @Column(name = “addressid”, unique = true, nullable = false, insertable = true, updatable = true)
    public Long getAddressid() {
    return this.addressid;
    }

    I think it ought to contain a @GeneratedValue like this:


    @Id

    @GeneratedValue
    @Column(name = “addressId”, unique = true, nullable = false, insertable = true, updatable = true)
    public Long getAddressId() {
    return this.addressId;
    }

    What am I missing here?
    Thanks in advance,
    Ken Bowen

    #289713 Reply

    Loyal Water
    Member

    Ken,
    This is a known issue that the dev team is already working on. Im sorry you ran into this issue. We shall try to get it fixed asap.

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: Difficulty with JPA RevEng + Postgres + BIGSERIAL

You must be logged in to post in the forum log in