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 7642739
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T09:15:59+00:00 2026-05-31T09:15:59+00:00

Confronted with the problem – ////////////////// GbCapacityEntity class ////////////////// @Entity @Cache(usage = org.hibernate.annotations.CacheConcurrencyStrategy.NONE) @Table(name

  • 0

Confronted with the problem –

////////////////// GbCapacityEntity class //////////////////
@Entity
@Cache(usage = org.hibernate.annotations.CacheConcurrencyStrategy.NONE)
@Table(name = "MARKSIST.GB_CAPACITY")
public class GbCapacityEntity {
    @Id
    @Column(name = "ORG_ID")
    private Integer orgId;
...
    @OneToMany(cascade = CascadeType.ALL,fetch=FetchType.LAZY,mappedBy="gbCapacityEntity")
    private List<GbLoadForecast> gbLoadForecast;
    /**
     * 
     * @return
     */
    public List<GbLoadForecast> getGbLoadForecast() {
        return gbLoadForecast;
    }
    /**
     * 
     * @param gbLoadForecast
     */
    public void setGbLoadForecast(List<GbLoadForecast> gbLoadForecast) {
        this.gbLoadForecast = gbLoadForecast;
    }



////////////////// GbLoadForecast class ////////////////// 
@Entity
@Cache(usage = org.hibernate.annotations.CacheConcurrencyStrategy.NONE)
@Table(name = "MARKSIST.GB_LOAD_FORECAST")
public class GbLoadForecast {
    @Id 
    @Column(name = "ORG_ID")
    private Integer orgId;
...
    @ManyToOne(cascade = {CascadeType.REFRESH}, fetch = FetchType.LAZY)
    private GbCapacityEntity gbCapacityEntity;
    /**
     * @return
     */
    public GbCapacityEntity getGbCapacityEntity() {
        return gbCapacityEntity;
    }
    /**
     * @param gbLoadForecast
     */
    public void setGbCapacityEntity(GbCapacityEntity gbCapacityEntity) {
        this.gbCapacityEntity = gbCapacityEntity;
    }
...

////////////////// Some query //////////////////  

        String hql = "FROM com.intellex.marksist.hbn.model.GbLoadForecast E " +
                     "WHERE E.orgId = :id1 AND E.cargoGroup = :id2";

        Session session = HibernateUtil.getMarksistSessionFactory().openSession();
        session.beginTransaction();

        Query query = session.createQuery(hql);
        query.setParameter("id1", orgId);
        query.setParameter("id2", gcId);
        List results = query.list();
        session.close();
...

On the instructions query.list(); thrown exception –
[java] 4085 [“http-apr-8080”-exec-10] ERROR org.hibernate.util.JDBCExceptionReporter – ORA-00904: “GBLOADFORE0_”.”GBCAPACITYENTITY_ORG_ID”: ???????????? ?????????????

Anybody know why? I would be very grateful! : -)

=========================================

Added @ JoinColumn annotation in the child class, and now it looks like this –

////////////////// GbLoadForecast class ////////////////// 
@Entity
@Cache(usage = org.hibernate.annotations.CacheConcurrencyStrategy.NONE)
@Table(name = "MARKSIST.GB_LOAD_FORECAST")
public class GbLoadForecast {
    @Id 
    @Column(name = "ORG_ID")
    private Integer orgId;
...
    @ManyToOne(cascade = {CascadeType.REFRESH}, fetch = FetchType.LAZY)
    @JoinColumn(name = "ORG_ID")
    private GbCapacityEntity gbCapacityEntity;
    /**
     * @return
     */
    public GbCapacityEntity getGbCapacityEntity() {
        return gbCapacityEntity;
    }
    /**
     * @param gbLoadForecast
     */
    public void setGbCapacityEntity(GbCapacityEntity gbCapacityEntity) {
        this.gbCapacityEntity = gbCapacityEntity;
    }
...

But now another exception – Caused by: org.hibernate.MappingException: Repeated column in mapping for entity: com.intellex.marksist.hbn.model.GbLoadForecast column: ORG_ID (should be mapped with insert = “false” update = “false” )

The thing is, i suspect that there are a bunch of the same name of the field-name ORG_ID column is as in table MARKSIST.GB_LOAD_FORECAST, and in the table MARKSIST.GB_CAPACITY. Or is not it?

  • 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-31T09:16:00+00:00Added an answer on May 31, 2026 at 9:16 am

    Let’s examine this mapping:

    @Id 
    @Column(name = "ORG_ID")
    private Integer orgId;
    ...
    @ManyToOne(cascade = {CascadeType.REFRESH}, fetch = FetchType.LAZY)
    @JoinColumn(name = "ORG_ID")
    private GbCapacityEntity gbCapacityEntity;
    

    This means that the ID is mapped to the column ORG_ID, and that you also have a column, which is a foreign key to the GB_CAPACITY.ORG_ID column, and which is also named ORG_ID.

    You can’t have two columns with the same name in the same table. Choose a different name for your join column:

    @JoinColumn(name = "ORG_ID_OF_CAPACITY")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am confronted to a problem that is driving me crazy. I really do
Actually I am confronted with a Problem. I've got a .apk-File in one Package
I'm confronted by a strange jQuery problem. I was asked to help figure out
I am confronted with a problem where I have a massive list of information
I see myself regularly confronted with the following problem. I have some kind of
When creating a Funds or Assets table, I am often confronted with the same
I'm often confronted with the following situation: I have some data in a table
I am confronted with a new kind of problem which I haven't encountered yet
To start sorry for my bad english. I am confronted to a problem. I
I've got a class called List_Field that, as the name suggests, builds list input

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.