-->
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.  [ 1 post ] 
Author Message
 Post subject: @ManyToOne invalid identifier exception
PostPosted: Tue Oct 19, 2010 12:27 pm 
Newbie

Joined: Mon Dec 25, 2006 4:59 am
Posts: 15
Hi guys
During migration from xml files to annotations I have found myself struggling with many to one association.

in xml mapping it was a simple line of
Code:
<class name="B" table="B" dynamic-insert="true">
  ...
  <many-to-one name="C" column="TYPE" class="com.company.domain.C" not-null="true"/>
  ...              
</class>


while with annotations I am trying to do it like this
Code:
@Entity
@Table(name = "B")
@org.hibernate.annotations.Entity(dynamicInsert = true)
class B extends A
{
    @ManyToOne(targetEntity = C.class)
    @JoinColumn(name = "TYPE", nullable=false)
    private C innerParameter;

}


Code:
@Entity
@Table(name = "C")
public class C
{
    @Id
    @Column(name = "TYPE")
    private short id;
    ...
}


And I am getting this exception
WARN [org.hibernate.util.JDBCExceptionReporter] - <SQL Error: 904, SQLState: 42000>
ERROR [org.hibernate.util.JDBCExceptionReporter] - <ORA-00904: "B0_"."TYPE": invalid identifier

please help !


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

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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.