Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4072840
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T16:56:08+00:00 2026-05-20T16:56:08+00:00

I’m getting this exception in an attempt to persist an entity object in an

  • 0

I’m getting this exception in an attempt to persist an entity object in an Oracle database, and I only started getting this error after switching my JPA project to EclipseLink 2.0 from Hibernate, and I’m using “entity inheritance” if this could have anything to do with it (which I highly suspect).

*

Caused by: javax.persistence.PersistenceException: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.0.1.v20100213-r6600): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: ORA-00957: duplicate column name
Error Code: 957
Call: INSERT INTO SUREC (ID, PERSON_ID, SURECID, VERSIYONNO, FAZ, FORM_TARIH, DURUMKODU_ID, surecId) VALUES (...

*

The exception message suggests that SURECID is generated twice in the SQL which seems to be causing the duplicate column error, however surecId is defined once as a property and annotated as a discriminator column in the entity class: (see below)

The base entity class resembles:

@Entity
@Inheritance(strategy=InheritanceType.JOINED)
@DiscriminatorColumn(name = "surecId")
public class Surec implements java.io.Serializable {

    private static final long serialVersionUID = -6008473677883005878L;
    @Column(name = "ID")
    private Long id;
    @Basic(optional = false)
    @Column(name = "FAZ")
    private int faz;
    @Basic(optional = false)
    @Column(name = "FORM_TARIH")
    @Temporal(TemporalType.DATE)
    private Date formTarih;
    @Column(name = "PERSON_ID")
    private Integer personId;
    // @Column(name = "SURECID", updatable = false, length=17)
    @Column(updatable = false, length=17)
    private String surecId;
    @Column(name = "VERSIYONNO")
    private Long versiyonno;
    @JoinColumn(name = "DURUMKODU_ID", referencedColumnName = "ID")
    @ManyToOne
    private DurumKod durumKodu;

    public Surec() {
    }

    public Surec(String surecId) {
        this.surecId = surecId;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }
    .
    .
    .
    public String getSurecId() {
        return surecId;
    }

    public void setSurecId(String surecId) {
        this.surecId = surecId;
    }
    .
    .
    .

I commented the “@Column(name=…” annotation jus to see if it could be causing the duplicate column error, but it didn’t work out.

And below is the polymorphic entity extending Surec.java above:

@Entity
@DiscriminatorValue("atf")
public class MailOrder extends Surec {
    private static final long serialVersionUID = 8333637555543614502L;

    @Column(name = "AMOUNT")
    private Double amount;
    @Basic(optional = false)
    @Column(name = "CURRENCY", length = 17)
    private String currency;
    @Column(name = "BANK")
    private String Bank;
    @Column(name = "ACCOUNT_ID", length = 31)
    private String accountId;
    @Column(name = "INVOICE_ID")
    private Integer invoiceId;

    public MailOrder() {
    }

    public MailOrder(String surecId) {
        super(surecId);
    }

    public String getCurrency() {
        return currency;
    }
    .
    .
    .

The error occurs when I try to persist this very sub-entity.
It doesn’t override any property of its superclass, although I’m not sure if it’s the constructor…

Any advise to resolve the problem (and acknowledgement of any possible EclipseLink or Oracle (or my!) bug will be appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T16:56:08+00:00Added an answer on May 20, 2026 at 4:56 pm

    This is a common issue if you have a relationship mapping that uses this field, and has to do with case sensitivity. Try indicating the descriminator colum as
    @DiscriminatorColumn(name = “SURECID”)

    EclipseLink is case sensitive by default, which is why surecId is seen as a different field from SURECID. You can make EclipseLink case insensitive by using the eclipselink.jpa.uppercase-column-names property, which when set to true, forces EclipseLink to use the upper case on field name comparisons.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.