Results 1 to 3 of 3
  1. #1
    Nick15 is offline Member
    Join Date
    May 2007
    Posts
    38
    Rep Power
    0

    Default Hibernate, help me

    I have the classes:
    Java Code:
    public class Rol {
        private int id;
        private Set projectMember = new HashSet();
        private String description;
     
        ....getters y setters....
    }
     
     
    public class ProjectMember {
        private int id;
        private Member member;
        private Project project;
     
     
        ....getters y setters....
    }
    the xml
    Java Code:
    hibernate-mapping>
        <class name="Model.Rol" table="item10.role">
            <id name="id" type="int" column="OID">
                <generator class="native"/>
            </id>
            <property name="description" column="DESCRIPTION"/>
            <set name="projectMember" table="item10.pm_roles">
                <key column="ELT"/>
                <many-to-many class="Model.ProjectMember" column="id_projectmember"/>  
            </set>
        </class>
    </hibernate-mapping>
    I have the ProjectMember.hbm.xml too
    And i try to do a query with HQL:

    Query query = session.createQuery("select m FROM Model.Member m, Model.Projec p, Model.Rol r, Model.ProjectMember pMember where r.projectMember.proyecto.id=p.id ");

    the red sentence gives me an error. If I use r.projectMember.id works fine but if I use r.projectMember.project.id gives me the error before mentioned.

    why?
    Last edited by Nick15; 06-01-2007 at 01:16 AM.

  2. #2
    roland is offline Member
    Join Date
    May 2007
    Posts
    2
    Rep Power
    0

    Default

    would need to see the Project code and mapping to be sure but maybe Project.id does not exist and/or is not mapped

    what exactly is the error you get? got a stackdump?

  3. #3
    JForum4Hari is offline Member
    Join Date
    Jun 2008
    Posts
    5
    Rep Power
    0

    Default

    Hi Nick15 ,

    If you post the error message, it will be more clear.

Similar Threads

  1. Hibernate sql query
    By taicode in forum JDBC
    Replies: 0
    Last Post: 03-25-2008, 04:17 PM
  2. question about hibernate
    By bbq in forum JDBC
    Replies: 1
    Last Post: 07-09-2007, 04:04 AM
  3. Replies: 2
    Last Post: 06-30-2007, 03:01 PM
  4. Hibernate
    By Alan in forum JDBC
    Replies: 2
    Last Post: 05-11-2007, 01:19 AM
  5. Hibernate
    By Shuru in forum JDBC
    Replies: 2
    Last Post: 05-09-2007, 05:39 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •