Va el pedido....

Public Class ente
   Private _id As Integer
   Private _nombre As String
   Private _entetipo As entetipo
   Private _imagen As Byte()
   Public Overridable Property Id() As Integer
       Get
           Return _id
       End Get
       Set(ByVal Value As Integer)
           _id = Value
       End Set
   End Property
   Public Overridable Property Nombre() As String
       Get
           Return _nombre
       End Get
       Set(ByVal Value As String)
           _nombre = Value
       End Set
   End Property

   Public Overridable Property EnteTipo() As entetipo
       Get
           Return _entetipo
       End Get
       Set(ByVal Value As entetipo)
           _entetipo = Value
       End Set
   End Property

   Public Overridable Property Imagen() As Byte()
       Get
           Return _imagen
       End Get
       Set(ByVal Value As Byte())
           _imagen = Value
       End Set
   End Property

   Public Overridable Property EnteTipoNombre() As String
       Get
           Return EnteTipo.Nombre
       End Get
       Set(ByVal Value As String)
           EnteTipo.Nombre = Value
       End Set
   End Property

   Public Overrides Function ToString() As String
       Return Nombre
   End Function

End Class

Public Class entetipo
   Private _id As Integer
   Private _nombre As String
   Public Overridable Property Id() As Integer
       Get
           Return _id
       End Get
       Set(ByVal Value As Integer)
           _id = Value
       End Set
   End Property
   Public Overridable Property Nombre() As String
       Get
           Return _nombre
       End Get
       Set(ByVal Value As String)
           _nombre = Value
       End Set
   End Property

   'Public Overrides Function ToString() As String
   '    Return Nombre
   'End Function

End Class
Public Class estadotarea
   Private _id As Integer
   Private _nombre As String

   Public Overridable Property Id() As Integer
       Get
           Return _id
       End Get
       Set(ByVal Value As Integer)
           _id = Value
       End Set
   End Property
   Public Overridable Property Nombre() As String
       Get
           Return _nombre
       End Get
       Set(ByVal Value As String)
           _nombre = Value
       End Set
   End Property

   'Public Overrides Function ToString() As String
   '    Return Nombre
   'End Function

End Class
Public Class tareas
   Private _id As Integer
   Private _descripcion As String
   Private _detalle As String
   Private _enteasigno As ente
   Private _entesolicito As ente
   Private _enteencargado As ente
   Private _estadotarea As estadotarea
   Private _alta As Date
   Private _finalizar As Date
   Private _finalizado As Date

   Public Overridable Property Id() As Integer
       Get
           Return _id
       End Get
       Set(ByVal Value As Integer)
           _id = Value
       End Set
   End Property

   Public Overridable Property Alta() As Date
       Get
           Return _alta
       End Get
       Set(ByVal Value As Date)
           _alta = Value
       End Set
   End Property

   Public Overridable Property Finalizar() As Date
       Get
           Return _finalizar
       End Get
       Set(ByVal Value As Date)
           _finalizar = Value
       End Set
   End Property

   Public Overridable Property Finalizado() As Date
       Get
           Return _finalizado
       End Get
       Set(ByVal Value As Date)
           _finalizado = Value
       End Set
   End Property

   Public Overridable Property Descripcion() As String
       Get
           Return _descripcion
       End Get
       Set(ByVal Value As String)
           _descripcion = Value
       End Set
   End Property

   Public Overridable Property Detalle() As String
       Get
           Return _detalle
       End Get
       Set(ByVal Value As String)
           _detalle = Value
       End Set
   End Property

   Public Overridable Property EnteAsigno() As ente
       Get
           Return _enteasigno
       End Get
       Set(ByVal Value As ente)
           _enteasigno = Value
       End Set
   End Property

   Public Overridable Property EnteSolicito() As ente
       Get
           Return _entesolicito
       End Get
       Set(ByVal Value As ente)
           _entesolicito = Value
       End Set
   End Property

   Public Overridable Property EnteEncargado() As ente
       Get
           Return _enteencargado
       End Get
       Set(ByVal Value As ente)
           _enteencargado = Value
       End Set
   End Property

   Public Overridable Property EstadoTarea() As estadotarea
       Get
           Return _estadotarea
       End Get
       Set(ByVal Value As estadotarea)
           _estadotarea = Value
       End Set
   End Property

   'Public Overridable ReadOnly Property EnteSolicitoNombre() As
String
   '    Get
   '        Return EnteSolicito.Nombre
   '    End Get
   'End Property

   Public Overridable ReadOnly Property EnteEncargadoNombre() As
String
       Get
           Return EnteEncargado.Nombre
       End Get
   End Property

   'Public Overridable ReadOnly Property EnteAsignoNombre() As String
   '    Get
   '        Return EnteAsigno.Nombre
   '    End Get
   'End Property

   Public Overridable ReadOnly Property EstadoTareaNombre() As String
       Get
           Return EstadoTarea.Nombre
       End Get
   End Property

End Class

<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="Tareas"
namespace="Tareas">
        <class name="ente" table="ente">

                <id name="Id" column="id" type="Int32" unsaved-value="0">
                        <generator class="native"/>
                </id>
   <property column="nombre" type="String" name="Nombre"
not-null="true" length="100" />
   <property column="imagen" type="Byte[]" name="Imagen" />
   <many-to-one name="EnteTipo" column="entetipo" class="entetipo"
lazy="false"/>
 </class>
</hibernate-mapping>

<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="Tareas"
namespace="Tareas">
        <class name="entetipo" table="entetipo">

                <id name="Id" column="id" type="Int32" unsaved-value="0">
                        <generator class="native"/>
                </id>

   <property column="nombre" type="String" name="Nombre" />

 </class>
</hibernate-mapping>
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="Tareas"
namespace="Tareas">
        <class name="estadotarea" table="estadotarea">

                <id name="Id" column="id" type="Int32" unsaved-value="0">
                        <generator class="native"/>
                </id>

   <property column="nombre" type="String" name="Nombre" />

 </class>
</hibernate-mapping>
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="Tareas"
namespace="Tareas">
        <class name="tareas" table="tarea">

                <id name="Id" column="id" type="Int32" unsaved-value="0">
                        <generator class="native"/>
                </id>
   <property column="descripcion" type="String" name="Descripcion"/>
   <property column="detalle" type="String" name="Detalle"/>
   <property column="alta" name="Alta"/>
   <property column="finalizar" name="Finalizar"/>
   <property column="finalizado" name="Finalizado"/>
   <many-to-one name="EnteAsigno" column="enteasigno" class="ente"/>
   <many-to-one name="EnteEncargado" column="enteencargado"
class="ente" />
   <many-to-one name="EnteSolicito" column="entesolicito"
class="ente"/>
   <many-to-one name="EstadoTarea" column="estadotarea"
class="estadotarea"/>
 </class>

</hibernate-mapping>


--~--~---------~--~----~------------~-------~--~----~
Para escribir al Grupo, hágalo a esta dirección: 
[email protected]
Para más, visite: http://groups-beta.google.com/group/NHibernate-Hispano
-~----------~----~----~----~------~----~------~--~---

Responder a