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 !