RE: Validation failure loading an object

From: Gentry, Michael \(Contractor\) ("Gentry,)
Date: Tue Jan 04 2005 - 14:40:52 EST

  • Next message: Joaquin Arias Buendia: "Not use Cayenne's object validation"

    Is "cod_rf" defined for all records in your database? It sounds like you might have some nulls there.

    /dev/mrg

    -----Original Message-----
    From: Joaquin Arias Buendia [mailto:joaqinbuendiaforu..ahoo.es]
    Sent: Tuesday, January 04, 2005 1:43 PM
    To: cayenne-use..bjectstyle.org
    Subject: Validation failure loading an object

    Hi everybody! I have problem.

    When I try to load an object from database I obtain
    this message:

    ---------------------
    Validation failure for ivoting.RespuestaFija.cod_rf:
    "cod_rf" is required.
    ---------------------

    cod_rf is primary key in database and RespuestaFija is
    the class.

    cod_rf is defined in RespuestaFija as:
    public static final String COD_RF_PK_COLUMN =
    "cod_rf";

    Mapping file contains:

     <db-entity name="RespuestaFija" catalog="ivoting">
      <db-attribute name="cod_p" type="INTEGER"
    isMandatory="true" length="10"/>
      <db-attribute name="cod_rf" type="INTEGER"
    isPrimaryKey="true" isMandatory="true" length="10"/>
      <db-attribute name="contador_rf" type="INTEGER"
    isMandatory="true" length="10"/>
                    <db-attribute
    name="contador_rf_auditoria" type="INTEGER"
    isMandatory="true" length="10"/>
      <db-attribute name="resp_rf" type="VARCHAR"
    isMandatory="true" length="75"/>
     </db-entity>

     <obj-entity name="RespuestaFija"
    className="ivoting.RespuestaFija"
    dbEntityName="RespuestaFija">
                    <obj-attribute
    name="contadorAuditoria" type="java.lang.Integer"
    db-attribute-path="contador_rf_auditoria"/>
      <obj-attribute name="contador"
    type="java.lang.Integer"
    db-attribute-path="contador_rf"/>
      <obj-attribute name="resp" type="java.lang.String"
    db-attribute-path="resp_rf"/>
     </obj-entity>

    Can you help me, please? Thank you very much!!!

                    
    ______________________________________________
    Renovamos el Correo Yahoo!: ˇ250 MB GRATIS!
    Nuevos servicios, más seguridad
    http://correo.yahoo.es



    This archive was generated by hypermail 2.0.0 : Tue Jan 04 2005 - 14:40:59 EST