Hola , no se si lo solucionaste, yo no trabajo con ibatis, y que no tenga un
constructor no deberia influir pero……

 

El constructor esta comentado

 

    //public Categorias()

        //{

        //}

 

 

  _____  

De: [email protected] [mailto:[EMAIL PROTECTED] En nombre de Leandro
Tuttini
Enviado el: martes, 19 de diciembre de 2006 13:00
Para: [email protected]
Asunto: [puntonet] IBatis - consulta navegacion entidades

 

Hola:

 

Que tal, le pido si me pueden ayudad en este caso, es muy tonto pero me esta
volviendo loco.

 

Se que por ahi no e sla lista ideal para preguntar sobre IBatis, si conocen
alguna mas especializada sobre el tema sera de ayuda.

 

El tema es el siguiente, trabajr con objetos simples persistiendo funciona
regio, pero queria probar la navegacion de objetos y en este ejemplo que
arme me esta fallando.

 

El error que me muestra es el siguiente.

CategoriasMapping.Modelos.ModeloEntity..ctor()

 

La descripcion larga del error seria:

 

  at CreateImplementation(Object[] )
   at
IBatisNet.Common.Utilities.Objects.DelegateFactory.Create.Invoke(Object[]
parameters)
   at
IBatisNet.Common.Utilities.Objects.DelegateFactory.CreateInstance(Object[]
parameters)
   at
IBatisNet.DataMapper.Configuration.ResultMapping.ResultMap.CreateInstanceOfR
esult(Object[] parameters)
   at
IBatisNet.DataMapper.MappedStatements.ResultStrategy.ResultMapStrategy.Proce
ss(RequestScope request, IDataReader& reader, Object resultObject)
   at
IBatisNet.DataMapper.MappedStatements.MappedStatement.RunQueryForList[T](Req
uestScope request, IDalSession session, Object parameterObject, Int32
skipResults, Int32 maxResults, RowDelegate`1 rowDelegate)
   at
IBatisNet.DataMapper.MappedStatements.MappedStatement.ExecuteQueryForList[T]
(IDalSession session, Object parameterObject, Int32 skipResults, Int32
maxResults)
   at
IBatisNet.DataMapper.MappedStatements.MappedStatement.ExecuteQueryForList[T]
(IDalSession session, Object parameterObject)
   at IBatisNet.DataMapper.SqlMapper.QueryForList[T](String statementName,
Object parameterObject)
   at CategoriasMapping.Modelos.Form1.button1_Click(Object sender, EventArgs
e) in
D:\Temp\IBatis\Pruebas\IBatisPruebas\CategoriasMapping\Modelos\Form1.cs:line
22
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons
button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Button.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd,
Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
   at
System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.Unsaf
eNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID,
Int32 reason, Int32 pvLoopData)
   at
System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32
reason, ApplicationContext context)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32
reason, ApplicationContext context)
   at System.Windows.Forms.Application.Run(Form mainForm)
   at CategoriasMapping.Program.Main() in
D:\Temp\IBatis\Pruebas\IBatisPruebas\CategoriasMapping\Program.cs:line 17
   at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
   at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence
assemblySecurity, String[] args)
   at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()

 

 

Yo ya me habia enfrentado a este problema una vez y se debia a que le
faltaba el constructor a la clase, pero esta vez lo verifique y esta todo
correcto.

 

El problema se da en el formulario de nombre Form1, dentro de la carpeta
"Modelo", ahi lo que queria hacer era tener una clase "Categoria" que
recuperara sus "Modelos", por mediod e una propiedade de navegacion.

 

O sea algo muy simple.

 

El codigo lo pueden bajar de esta url

 

http://gmy02.c-gmy.com/download/

 

 

Paso el script para la creacion de las tablas.

La base tiene el nombre de "IBatis", y esta en sql server 2000

 

if exists (select * from dbo.sysobjects where id =
object_id(N'[dbo].[FK_Articulo_Modelo]') and OBJECTPROPERTY(id,
N'IsForeignKey') = 1)
ALTER TABLE [dbo].[Articulos] DROP CONSTRAINT FK_Articulo_Modelo
GO

if exists (select * from dbo.sysobjects where id =
object_id(N'[dbo].[Articulos]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Articulos]
GO

if exists (select * from dbo.sysobjects where id =
object_id(N'[dbo].[Categorias]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Categorias]
GO

if exists (select * from dbo.sysobjects where id =
object_id(N'[dbo].[Modelo]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Modelo]
GO

if exists (select * from dbo.sysobjects where id =
object_id(N'[dbo].[Productos]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Productos]
GO

CREATE TABLE [dbo].[Articulos] (
 [modelo] [smallint] NOT NULL ,
 [articulo] [smallint] NOT NULL ,
 [descripcion] [char] (10) COLLATE Modern_Spanish_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[Categorias] (
 [id] [int] NOT NULL ,
 [descripcion] [varchar] (20) COLLATE Modern_Spanish_CI_AS NOT NULL ,
 [observaciones] [varchar] (255) COLLATE Modern_Spanish_CI_AS NULL ,
 [Tipo] [int] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[Modelo] (
 [modelo] [smallint] NOT NULL ,
 [descripcion] [char] (10) COLLATE Modern_Spanish_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[Productos] (
 [PRD_ID] [int] NOT NULL ,
 [PRD_CODE] [int] NOT NULL ,
 [PRD_DESCRIPTION] [varchar] (50) COLLATE Modern_Spanish_CI_AS NOT NULL ,
 [PRD_SUGGESTED_PRICE] [varchar] (50) COLLATE Modern_Spanish_CI_AS NOT NULL 
) ON [PRIMARY]
GO

 

Bueno espero me puedan ayudar.

Cualqueir duda consulten y les comento.

 

Mil gracias.

 __________________________________________________
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis! 
¡Abrí tu cuenta ya! - http://correo.yahoo.com.ar

Responder a