Announcement Announcement Module
Collapse
No announcement yet.
Strange thing happening with my jpa table join Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Strange thing happening with my jpa table join

    Hi Guys,

    I am trying to do a join on two tables using the following code:



    Code:
    @ManyToOne
    	@JoinColumns({
    		@JoinColumn(name="C_MAE_MTE_TRANSACTION_ID", referencedColumnName="C_MTE_TRANSACTION_ID")
    	})
    	public Trade getTrade() {
    		return trade;
    	}
    
    and I get the following exception, for some reason it is appending TRADE to the begining of my primary key on the Trade table as highlighted above.
    	at oracle.toplink.essentials.queryframework.ObjectLevelReadQuery.executeInUnitOfWork(ObjectLevelReadQuery.java:731)
    	at oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2219)
    	at oracle.toplink.essentials.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:937)
    	at oracle.toplink.essentials.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:909)
    	at oracle.toplink.essentials.internal.ejb.cmp3.base.EJBQueryImpl.executeReadQuery(EJBQueryImpl.java:346)
    	at oracle.toplink.essentials.internal.ejb.cmp3.base.EJBQueryImpl.getResultList(EJBQueryImpl.java:453)
    	at org.springframework.orm.jpa.JpaTemplate$9.doInJpa(JpaTemplate.java:307)
    	at org.springframework.orm.jpa.JpaTemplate.execute(JpaTemplate.java:185)
    	at org.springframework.orm.jpa.JpaTemplate.executeFind(JpaTemplate.java:152)
    	at org.springframework.orm.jpa.JpaTemplate.find(JpaTemplate.java:299)
    	at com.support.database.SupportDAOImpl.getTradeAlloction(SupportDAOImpl.java:57)
    	at com.support.testing.TestMyStuff.main(TestMyStuff.java:37)
    Caused by: java.sql.SQLException: ORA-00904: "TRADE_C_MTE_TRANSACTION_ID": invalid identifier
    Any clues would be great

    Thanks
Working...
X