IntelliJ Java IDE
The moose likes Object Relational Mapping and the fly likes @ManyToOne mapping question Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Object Relational Mapping
Reply Bookmark "@ManyToOne mapping question" Watch "@ManyToOne mapping question" New topic
Author

@ManyToOne mapping question

Matthew Snow
Ranch Hand

Joined: May 02, 2007
Posts: 64
This is a watered down version of my code (excuse and simple syntax errors).





The named query of the Employee entity works just fine, but when I try to create the named query for TimeEntry, I get this error:

java.sql.SQLException: ORA-00904: "TIMEENTRY0_"."EMPLOYEE_EMPLID": invalid identifier

I know this has to do with the annotations I use to map these two together. I've been playing around with different configuration, but I keep getting this error:

org.hibernate.MappingException: Repeated column in mapping for entity: egg.myapp.payroll.model.TimeEntry column: emplid (should be mapped with insert="false" update="false")

and I don't see how to define these attributes. I am in no way saying that the configuration I have is the best way to do this. Any help would be appreciated.


When you break the big rules, you get a lot of little rules.
Matthew Snow
Ranch Hand

Joined: May 02, 2007
Posts: 64
Resolution

 
 
subject: @ManyToOne mapping question
 
Threads others viewed
Invalid composite primary key specification
Can a class be mapped to a table and be Embeddable at the same time?
Prepared Statement and Date class - Problem still exists
Prepared Statement and Date class
Need help with Mapping(Annotation) and Composition
IntelliJ Java IDE