aspose file tools*
The moose likes Object Relational Mapping and the fly likes Unable to define/override @Id(s) on a subclass; which classes i have to solve? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Unable to define/override @Id(s) on a subclass; which classes i have to solve?" Watch "Unable to define/override @Id(s) on a subclass; which classes i have to solve?" New topic
Author

Unable to define/override @Id(s) on a subclass; which classes i have to solve?

Thanaphorn Thongthien
Greenhorn

Joined: Aug 03, 2010
Posts: 15
i got this error


Caused by: org.hibernate.AnnotationException: Unable to define/override @Id(s) on a subclass: MPrint.MVC.Model.Paper


and these are my codes



PaperSize


i just need the table Paper keep the data only PaperSizeNo

but the details of PaperSizeNo will keep in their table that have width, length and unit ( inch, cm)

for easy to manage the database,, another class of my project were create relation diagram like these problem classes

how can i solve it,, really need help ! (T - T)

in the early, i have already added the single class to DB and it's work!

what about the parent and child class?? i don't know where to adapt them..


ps. i'm quite new with these,, [first programming] - -'
Wendy Gibbons
Bartender

Joined: Oct 21, 2008
Posts: 1106

Thanaporn Thongthien wrote:

i just need the table Paper keep the data only PaperSizeNo

but the details of PaperSizeNo will keep in their table that have width, length and unit ( inch, cm)

for easy to manage the database,, another class of my project were create relation diagram like these problem classes



I am really sorry i tried helping you but i found some of the english really difficult to understand (quoted above) could you supply us with the database design indicating the foreign keys and another go at the quoted sentances.
Thanaphorn Thongthien
Greenhorn

Joined: Aug 03, 2010
Posts: 15
thanks for reply anyway and this is the database column that i will keep in PAPER and PAPERSIZE

Paper's Database will keep

PaperNo
PaperName
PaperType
PaperSizeNo
PaperGram
PaperPrice

PaperSize's Database

PaperSizeNo
PaperWidth
PaperLenght
PaperUnit

that is what i mean - - '
Wendy Gibbons
Bartender

Joined: Oct 21, 2008
Posts: 1106

ok, i am not sure if you are using annotations or xml files but look into the many-to-one annotation for the paperSizeNo column
and pay special attention to cascade.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Unable to define/override @Id(s) on a subclass; which classes i have to solve?
 
Similar Threads
JPA @ManyToOne
Creating an JPA in eclipse
@ManyToOne - extra column?
Annotated Entity Bean Inheritance
JPA MappingException: Repeated column in mapping for entity