Hi,
I'm new to NHibernate and I am having an issug mapping an object in our
generic dataloading application to a database.
The database is third party so we cant make changes there.
Our object is:
public class GenericObjectValue
{
public string ObjectId { get; set; }
public string ObjectTypeId { get; set; }
public string measurementId { get; set; }
public DateTime timestamp { get; set; }
public Double Value { get; set; }
}
Datasource tables we use:
Table t_data_point
id (PK, int, not null)
object_id (FK, Varchar(30), not null)
object_type_id (FK, Varchar(30), not null);
measurement_id (FK, Varchar(30), not null);
Table t_data_point_Value
data_point_id (PK, FK, int, not null)
timestamp (PK, FK, datetime, not null)
version (PK, FK, int, not null)
value (numeric(18,6), not null);
The mapping i have configured is:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
namespace="Phoenix.Model" assembly="Phoenix.Common">
<class name="MeasValue" table="t_data_point_Value">
<id column="data_point_id" type="int" />
<property name="Timestamp" column="timestamp "/>
<property name="Value" column="value"/>
<join table="t_data_point">
<key column="id" />
<property name="measurementId" column="measurement_id" />
<property name="ObjectId" column="object_id" />
<property name="ObjectTypeId" column="object_type" />
</join>
</class>
</hibernate-mapping>
Not sure if im doing something stupid or somthing that just isnt possible
but when i run the code for this i get back the correct number of results
but the results are just duplications of the first result returned i.e.
timestamp and value are the same.
If you need anymore infor please let me know.
Thanks for your help in advance.
Show trimmed content
Previous Previous
Page *1*
NextNext
--
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/nhusers?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.