You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Fernando Bernardino <fe...@ptcom.com.br> on 2004/09/10 16:10:27 UTC

Problem when updating and deleting with collection-descriptor

Hi everybody, 
I'm having a problem when deleting. The RDBMS returns: ORA-02292: integrity constraint (FK_name) violated - child record found.
My auto-delete is true in the collection-descriptor.

The other problem, is when I'm trying to update the same class, but only when I insert, or delete, objects in the collection. The error:
10:56:29,717 INFO  [STDOUT] SQLException during the execution of the update (for a br.com.ptcom.webField.model.AcaoVO): ORA-01861: literal does not match format string
10:56:29,717 INFO  [STDOUT] ORA-01861: literal does not match format string
10:56:29,717 ERROR [STDERR] java.sql.SQLException: ORA-01861: literal does not match format string
My auto-update is also true in the collection-descriptor.

The target class is AcaoVO.

Please, can you guys take a look in my repository below? I can't see the problem... I'm using OJB 1.0rc5 with Oracle8.1.7

<class-descriptor class="br.com.ptcom.webField.model.AcaoVO" table="LAB.ACAO" >
  <field-descriptor id="0"
    name="cdAcao"
    column="CD_ACAO"
    jdbc-type="VARCHAR"
    primarykey="true"
  />
  <field-descriptor id="1"
    name="dsAcao"
    column="DS_ACAO"
    jdbc-type="VARCHAR"
  />
  <field-descriptor id="2"
    name="nmAcao"
    column="NM_ACAO"
    jdbc-type="VARCHAR"
  />
  <field-descriptor id="3"
    name="dtAtualizacao"
    column="DT_ATUALIZACAO"
    jdbc-type="VARCHAR"
  />
  <field-descriptor id="4"
    name="nmUsuario"
    column="NM_USUARIO"
    jdbc-type="VARCHAR"
  />
  
  <collection-descriptor 
    name="subAcoes"
    element-class-ref="br.com.ptcom.webField.model.SubAcaoVO"
    auto-update="true"
    auto-delete="true"   
    auto-insert="true"  
    auto-retrieve="true"
  >
  <inverse-foreignkey field-ref="cdAcao"/>
  </collection-descriptor>
</class-descriptor>

<class-descriptor class="br.com.ptcom.webField.model.SubAcaoVO" table="LAB.SUB_ACAO" >
  <field-descriptor id="0"
    name="cdAcao"
    column="CD_ACAO"
    jdbc-type="VARCHAR"
    primarykey="true"
  />
  <reference-descriptor 
    name="acaoVO"
    class-ref="br.com.ptcom.webField.model.AcaoVO"
    auto-retrieve="true"
    >
   <foreignkey field-ref="cdAcao"/>
  </reference-descriptor>
  
  <field-descriptor id="1"
    name="cdSubAcao"
    column="CD_SUB_ACAO"
    jdbc-type="VARCHAR"
    primarykey="true"
  />
  <field-descriptor id="2"
    name="dsSubAcao"
    column="DS_SUB_ACAO"
    jdbc-type="VARCHAR"
  />
  <field-descriptor id="3"
    name="nmSubAcao"
    column="NM_SUB_ACAO"
    jdbc-type="VARCHAR"
  />
  <field-descriptor id="4"
    name="dtAtualizacao"
    column="DT_ATUALIZACAO"
    jdbc-type="VARCHAR"
  />
  <field-descriptor id="5"
    name="nmUsuario"
    column="NM_USUARIO"
    jdbc-type="VARCHAR"
  />
</class-descriptor>