No veo la declaración de TbLoteTiendaList pero no importa.
Bueno esa clase tiene un metodo no virtual y ese podría ser uno de los
motivos del error.
El otro posible motivo es constituido por todos los controles que estas
haciendo en el set de las propiedades (por cierto... los nombres que
escogiste son muy exóticos).
Ya que estas haciendo pruebas sacale el lazy=true a
<bag name="TbLoteTiendaList" inverse="true" lazy="true" >
así no necesita un proxy y vamos a ver lo que pasa (es que la clase que
mandaste hace referencias a otras clases y el problema podría estar en
una de las sub-class).
Chau.
Fabio.
p.s. Por favor pensalo bien si tus clases deberían llamarse todas con el
prefijo "Tb" o sea "Tabla" y si la propiedades que son instancias de
objetos deberían tener el prefijo "Id" (por ejemplo "IdProducto" que es
de tipo "TbProducto")
Julio Amigó escribió:
hola fabio, esta es la declaracion de la clase tbLoteTienda, como
puedes ver fue generada a partir de la base de datos con el template
de dario para myGeneration. Espero que con esto puedas ayudarme.
namespace EntidadesNegocio
{
[Serializable]
public class TbLoteTienda: IEquatable<TbLoteTienda>
{
#region Private Members
private int idlotetienda;
private IList<TbLoteVendido> TbLoteVendidoList;
private TbTienda idtienda;
private double precio;
private int cantidadtienda;
private string eliminado;
private TbLote idlote;
#endregion
#region Constructor
public TbLoteTienda()
{
idlotetienda = 0;
TbLoteVendidoList = new List<TbLoteVendido>();
idtienda = new TbTienda();
precio = new double();
cantidadtienda = 0;
eliminado = String.Empty;
idlote = new TbLote();
}
#endregion // End of Default ( Empty ) Class Constuctor
#region Required Fields Only Constructor
/// <summary>
/// required (not null) fields only constructor
/// </summary>
public TbLoteTienda(
int idlotetienda,
TbTienda idtienda,
double precio,
int cantidadtienda,
string eliminado,
TbLote idlote)
: this()
{
idlotetienda = idlotetienda;
idtienda = idtienda;
precio = precio;
cantidadtienda = cantidadtienda;
eliminado = eliminado;
idlote = idlote;
}
#endregion // End Constructor
#region Public Properties
public virtual int IdLoteTienda
{
get
{
return idlotetienda;
}
set
{
idlotetienda = value;
}
}
public virtual IList<TbLoteVendido> TbLoteVendidoList
{
get
{
return TbLoteVendidoList;
}
set
{
TbLoteVendidoList = value;
}
}
public virtual TbTienda IdTienda
{
get
{
return idtienda;
}
set
{
if( value == null )
throw new ArgumentOutOfRangeException("Null value
not allowed for IdTienda", value, "null");
idtienda = value;
}
}
public virtual double Precio
{
get
{
return precio;
}
set
{
precio = value;
}
}
public virtual int CantidadTienda
{
get
{
return cantidadtienda;
}
set
{
cantidadtienda = value;
}
}
public virtual string Eliminado
{
get
{
return eliminado;
}
set
{
if( value == null )
throw new ArgumentOutOfRangeException("Null value
not allowed for Eliminado", value, "null");
if( value.Length > 1)
throw new ArgumentOutOfRangeException("Invalid
value for Eliminado", value, value.ToString());
eliminado = value;
}
}
public virtual TbLote IdLote
{
get
{
return idlote;
}
set
{
if( value == null )
throw new ArgumentOutOfRangeException("Null value
not allowed for IdLote", value, "null");
idlote = value;
}
}
#endregion
#region Public Functions
public virtual void AddTbLoteVendido(TbLoteVendido obj)
{
#region Check if null
if (obj == null)
throw new ArgumentNullException("obj", "El parametro
no puede ser nulo");
#endregion
TbLoteVendidoList.Add(obj);
}
#endregion //Public Functions
#region Equals And HashCode Overrides
/// <summary>
/// local implementation of Equals based on unique value members
/// </summary>
public override bool Equals( object obj )
{
if( this == obj ) return true;
if( ( obj == null ) || ( obj.GetType() != this.GetType() )
) return false;
TbLoteTienda castObj = (TbLoteTienda)obj;
return ( castObj != null ) &&
( this.idlotetienda == castObj.IdLoteTienda );
}
/// <summary>
/// local implementation of GetHashCode based on unique value
members
/// </summary>
public override int GetHashCode()
{
int hash = 57;
hash = 27 ^ hash ^ idlotetienda.GetHashCode();
return hash;
}
#endregion
#region IEquatable members
public bool Equals(TbLoteTienda other)
{
if (other == this)
return true;
return ( other != null ) &&
( this.idlotetienda == other.IdLoteTienda );
}
#endregion
#region ToString
/// <summary>
/// ToString
/// </summary>
public override string ToString()
{
System.Text.StringBuilder sb = new
System.Text.StringBuilder();
sb.Append(idlotetienda.ToString());
sb.Append("|");
sb.Append(idtienda.ToString());
sb.Append("|");
sb.Append(precio.ToString());
sb.Append("|");
sb.Append(cantidadtienda.ToString());
sb.Append("|");
sb.Append(eliminado.ToString());
sb.Append("|");
sb.Append(idlote.ToString());
return sb.ToString();
}
#endregion // End Override ToString
}
}
saludos, julioDevp.
>
--~--~---------~--~----~------------~-------~--~----~
Para escribir al Grupo, hágalo a esta dirección:
[email protected]
Para más, visite: http://groups-beta.google.com/group/NHibernate-Hispano
-~----------~----~----~----~------~----~------~--~---