These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: NHibernate.HibernateException:Unable to resolve property:Plc
PostPosted: Tue Sep 07, 2010 4:01 pm 
Newbie

Joined: Wed Aug 25, 2010 12:52 pm
Posts: 12
Hi!
I get the error message in the title.
I have two classes (Geo.cs and Coordinates.cs). They have a one-to-one relationship.

Geo.cs:
Code:
        private int id;
        private string city;
        private string accessory;
        private Coordinates coordinates;
        private int areaCode;
        private string federalState;

       getters, setters and constructor...


Coordinates.cs
Code:
        private int plc;
        private double longitude;
        private double latitude;

        getters, setters and constructor...


I'd like to have a unique Plc in Coordinates.cs. It's primary key and also foreign key.
My Mapping files:

Code:
  <class name="Geo" table="geo_table">
    <id name="Id" column="id" type="Int32">
      <generator class="native"/>     
    </id>
    <property name="City" column="city" length="40" not-null="true"/>
    <property name="Accessory" column ="accessory" length="40" not-null="false"/>
    <property name="AreaCode" column="area_code" length="8" not-null="false"/>
    <property name="FederalState" column="federal_state" length="30" not-null="true"/>
    <one-to-one name="Coordinates" class="Coordinates" cascade="all"/>   
  </class>

AND

  <class name="Coordinates" table="plc_coordinates_table">
    <id name="Plc" column="plc" type="Int32" length="5">
      <generator class="foreign">       
        <param name ="property">Plc</param>
      </generator>     
    </id>
    <property name="Longitude" column="longitude"/>
    <property name="Latitude" column="latitude"/>
  </class>


I tried also Coordinates instead of Plc as param name. But that doesn't work too.
Do you have any idea??

Regards, Joe


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.