facebook

What’s wrong with my hibernate mapping?

  1. MyEclipse IDE
  2.  > 
  3. Off Topic
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #288944 Reply

    naselay
    Member

    This is the scenario of my problem.

    A moment ago, i was writing a mapping for my object Person. After i listed the mapping for the ID of the person, i proceeded to create a mapping for the remaining fields of the Person object. Upon writing this line,

    <property name=”lastName” type = “string” column = “FIRST_NAME”/>

    an error sign (red X mark) occurred at the left corner of myEclipse window telling me that

    Multiple annotations found at this line:
    – “Attribute ‘column’ must be declared for element type ‘property’ ”
    – “Attribute ‘type’ must be declared for element type ‘property’ “

    But that’s what i did, I placed those attributes INSIDE the property tag.

    This makes me wonder now what made the code erroneous. And, how come the mapping syntax didn’t work if it worked in NetBeans. I was thinking if it is a mapping syntax error or just a few setting flaw of MyEclipse.

    Thanks in advance for everyone who will help!

    #288953 Reply

    Loyal Water
    Member

    Can you paste a sample file here that would help me reproduce this issue.

    #289045 Reply

    naselay
    Member

    thanks for your help ^_^ but the previous problem was already solved… unfortunately, i have a new problem.

    I now have 5 classes… Item, Section, Group and Form are subclasses of Data..

    Class Data contains the common attribute of its subclasses which is ID only.

    The problem is, i don’t know how to map id from the subclasses to their corresponding tables….

    Is possible to map the field of superclass using the subclass.. if yes, then HOW?????

    #289110 Reply

    Brian Fernandes
    Moderator

    naselay

    This really is not a MyEclipse question, but I would suggest reading the following chapter on Hibernate Inheritance for a few pointers, there are several ways in which you could design your solution.

    http://www.hibernate.org/hib_docs/reference/en/html/inheritance.html

    Hope this helps.
    Brian.

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: What’s wrong with my hibernate mapping?

You must be logged in to post in the forum log in