-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: JPA Invalid Identifier Error
PostPosted: Wed Jan 11, 2017 6:15 pm 
Newbie

Joined: Wed Jan 11, 2017 6:13 pm
Posts: 1
I have two entity class having relationship one to one. while fetching data, I am getting below error.

Note: In "EPLAN_ELEMENT_DEFINITION" table primary key is "ELEMENT_DEFINITION_ID" and in "EPLAN_INPUT_ELEMENT" table foreign key is "INPUT_ELEMENT_ID". Basically name of keys are different in both tables.

**************** ERR****************

08:50:52.536 DEBUG [http-bio-8080-exec-8][SqlExceptionHelper] could not extract ResultSet [n/a] java.sql.SQLSyntaxErrorException: ORA-00904: "ELEMENTDEF0_"."INPUTELEMENT": invalid identifier

**************** ERR****************

Source Code:-

ElementDefinition:

Code:
@Entity

@Table(name = "EPLAN_ELEMENT_DEFINITION")

@Inheritance(strategy = InheritanceType.SINGLE_TABLE)

@DiscriminatorColumn(name = "TYPE", discriminatorType = DiscriminatorType.STRING)

public abstract class ElementDefinition extends au.gov.nsw.lpi.bds.eplan.elements.ElementDefinition
{
    @Id
    @Column(name = "ELEMENT_DEFINITION_ID")
    private Long id;
    @Column(name = "NAME")
    @Enumerated(EnumType.STRING)
    private ElementName name;


    @Column(name = "DESCRIPTION")
    private String description;

    public Long getId() {
        return id;
    }

    public String getDescription() {
        return description;
    }

    private InputElement inputElement;

    @OneToOne(mappedBy = "elementDefinition")
    public InputElement getInputElement() {
        return inputElement;
    }

    public void setInputElement(InputElement inputElement) {
        this.inputElement = inputElement;
    }

    @Override
    public ElementName name() {
        return getName();
    }

    public ElementName getName() {
        return name;
    }
}


Input Element:

Code:
@Entity

@Table(name = "EPLAN_INPUT_ELEMENT")

public class InputElement implements Serializable
{


    private ElementDefinition elementDefinition;

     @Id
     @OneToOne
     @JoinColumn(name="INPUT_ELEMENT_ID", referencedColumnName="ELEMENT_DEFINITION_ID")     

     public ElementDefinition getElementDefinition() {
        return elementDefinition;
     }

     public void setElementDefinition(ElementDefinition elementDefinition) {
        this.elementDefinition = elementDefinition;
     }


    public void setDefaultMandatoryInd(String defaultMandatoryInd) {
        this.defaultMandatoryInd = defaultMandatoryInd;
    }

}


Top
 Profile  
 
 Post subject: Re: JPA Invalid Identifier Error
PostPosted: Thu Jan 12, 2017 2:25 am 
Hibernate Team
Hibernate Team

Joined: Thu Sep 11, 2014 2:50 am
Posts: 1628
Location: Romania
Looks like you have an INPUTELEMENT column in the database table. Can you post the table schema as well?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.