i had this problem
No row with the given identifier exists: , of class: cl.mtt.rntpp.db.VehiculoTP
cl.mtt.rntpp.exception.InfrastructureException: No row with the given identifier exists: , of class: cl.mtt.rntpp.db.VehiculoTP
at cl.mtt.rntpp.dao.VehiculoTPDAO.getVehiculoByPatente(VehiculoTPDAO.java:38)
at cl.mtt.rntpp.test.TestVehiculo.main(TestVehiculo.java:22)
i have a recursive many-to-one relation
would you help me please??
it is the mapping ...
<hibernate-mapping>
<class name="cl.mtt.rntpp.db.VehiculoTP" table="vehiculo">
<id name="patente_vehiculo" column="patente_vehiculo" type="string" unsaved-value="null">
<generator class="assigned"/>
</id>
<property name="gases_vehiculo" type="string" column="gases_vehiculo" />
<property name="capacidad" type="java.lang.Long" column="capacidad"/>
<many-to-one name="servicio" column="id_servicio" class="cl.mtt.rntpp.db.ServicioTP" not-null="true" />
<property name="doc_cancelacion" type="string" column="doc_cancelacion"/>
<property name="estado_vehiculo" type="string" column="estado_vehiculo" not-null="true"/>
<property name="fecha_cancelado" type="date" column="fecha_cancelado" />
<property name="fecha_doc_cancelacion" type="date" column="fecha_doc_cancelacion"/>
<property name="fecha_entrada" type="date" column="fecha_entrada" not-null="true"/>
<property name="region_destino" type="java.lang.Long" column="region_destino" not-null="false"/>
<property name="rut_persona_cancela" type="java.lang.Long" column="rut_persona_cancela" not-null="false"/>
<property name="tipo_cancelacion" type="string" column="tipo_cancelacion" not-null="false"/>
<property name="usuario" type="string" column="usuario" not-null="true"/>
<property name="comentario_cancelacion" type="string" column="comentario_cancelacion" not-null="false"/>
<property name="doc_inscripcion" type="string" column="doc_inscripcion" not-null="false"/>
<property name="fecha_doc_inscripcion" type="date" column="fecha_doc_inscripcion" not-null="false"/>
<property name="reemplazado_por" type="string" column="reemplazado_por" not-null="false"/>
<many-to-one name="patente_reemplaza"
class="cl.mtt.rntpp.db.VehiculoTP"
column="patente_reemplaza" not-null="false" outer-join="true"/>
<set name="reemplazados" table="vehiculo" cascade="none" inverse="true" >
<key column="patente_reemplaza"/>
<one-to-many class="cl.mtt.rntpp.db.VehiculoTP"/>
</set>
<joined-subclass name="cl.mtt.rntpp.db.BusTP" table="bus">
<key column="patente_vehiculo"/>
<property name="numero_logo" type="string" column="numero_logo" not-null="false"/>
<property name="fecha_otorgamiento_logo" type="date" column="fecha_otorgamiento_logo" not-null="false"/>
<property name="tipo_cobrador" type="string" column="tipo_cobrador" not-null="false"/>
<property name="marca_cobrador" type="string" column="marca_cobrador" not-null="false"/>
<property name="modelo_cobrador" type="string" column="modelo_cobrador" not-null="false"/>
</joined-subclass>
<joined-subclass name="cl.mtt.rntpp.db.TaxiTP" table="taxi">
<key column="patente_vehiculo"/>
<property name="marca_taximetro" type="string" column="marca_taximetro" not-null="false"/>
<property name="modelo_taximetro" type="string" column="modelo_taximetro" not-null="false"/>
<property name="codigo_taximetro" type="string" column="codigo_taximetro" not-null="false"/>
</joined-subclass>
</class>
</hibernate-mapping>
thanks,
|