Hi, I'm having the following error, but I don't know what to do.
This is the error:
"could not determine a property type".
I have a "Persona" class like this:
using System;
using System.Collections;
namespace NHibernateWinForms
{
/// <summary>
/// Summary description for Class1.
/// </summary>
public class Persona
{
public Persona()
{
//
// TODO: Add constructor logic here
//
}
int _id = 0;
string _nombre = "";
string _apellido = "";
IList _direcciones = new ArrayList(); // Uno a muchos
public int Id
{
get{return _id;}
set{_id = value;}
}
public string Nombre
{
get{return _nombre;}
set{_nombre = value;}
}
public string Apellido
{
get{return _apellido;}
set{_apellido = value;}
}
public IList Direcciones
{
get { return this._direcciones; }
}
}
}
And a "Direcciones" class like this:
using System;
namespace NHibernateWinForms
{
/// <summary>
/// Summary description for Direccion.
/// </summary>
public class Direccion
{
public Direccion()
{
//
// TODO: Add constructor logic here
//
}
int _id = 0;
int _numero = 0;
int _piso = 0;
int _personaId = 0;
string _tipo = "";
string _calle = "";
string _depto = "";
string _telefono = "";
Persona _persona = new Persona(); // Muchos a uno
public int Id
{
get{return _id;}
set{_id = value;}
}
public int Numero
{
get{return _numero;}
set{_numero = value;}
}
public int Piso
{
get{return _piso;}
set{_piso = value;}
}
public string Tipo
{
get{return _tipo;}
set{_tipo = value;}
}
public string Calle
{
get{return _calle;}
set{_calle = value;}
}
public string Depto
{
get{return _depto;}
set{_depto = value;}
}
public string Telefono
{
get{return _telefono;}
set{_telefono = value;}
}
public Persona Persona
{
get { return this._persona; }
set
{
this._persona = value;
if (value != null)
{
this._personaId = value.Id;
}
}
}
}
}
In the xml I wrote the next:
<class name="NHibernateWinForms.Persona, NHibernateWinForms" table="Persona" discriminator-value="?">
<id name="Id" column="PersonaId" unsaved-value="0">
<generator class="identity" />
</id>
<property name="Nombre" column="PersonaNombre" not-null="false" />
<property name="Apellido" column="PersonaApellido" not-null="false" />
<property name="Direcciones" column="PersonaDireccion" not-null="false" />
<bag name="Direcciones" cascade="all" access="nosetter.camelcase" lazy="false" inverse="true">
<key column="PersonaId" />
<one-to-many class="NHibernateWinForms.Direccion, NHibernateWinForms" />
</bag>
</class>
<class name="NHibernateWinForms.Direccion, NHibernateWinForms" table="Direccion" discriminator-value="?">
<id name="Id" column="DireccionId" unsaved-value="0">
<generator class="identity" />
</id>
<property name="Tipo" column="DireccionTipo" not-null="true" />
<property name="Calle" column="DireccionCalle" not-null="true" />
<property name="Numero" column="DireccionNumero" not-null="true" />
<property name="Piso" column="DireccionPiso" not-null="false" />
<property name="Depto" column="DireccionDepto" not-null="false" />
<property name="Telefono" column="DireccionTelefono" not-null="false" />
<many-to-one name="Persona" column="PersonaId" class="NHibernateWinForms.Persona, NHibernateWinForms" cascade="none" />
</class>
But I get that error.
I don't know what exactly it means.
I have a "Persona" table, and a "Direccion" table.
The "Direccion" talbe has a foreign key to the Person table.
What I'm doing wrong?
Thanks a lot !!!
|