Gustavo,

Did you define the 
"collection-class=org.apache.ojb.broker.util.collections.ManageableArrayList" 
for the susDocumentos collection descriptor in repository.xml ?.

Zabi.





[EMAIL PROTECTED]
09/18/2003 02:32 AM
Please respond to OJB Users List

 
        To:     [EMAIL PROTECTED]
        cc: 
        Subject:        Problem with 1 to N mapping when retrieving into an ArrayList 
with ODMG 
API


Hi all,

We are using ODMG Api.
When trying to retrieve a person, who has documents collection (Documents 
as an ArrayList), OJB fails saying it needs a 
org.apache.ojb.broker.util.collections.RemovalAwareCollection (pls see 
error below)

It seems we should use a RemovalAwareCollection, or a Vector or a standar 
Collection. We would like to use ArrayList as a collection holder. Any 
workarounds?

Thanks in advance,
Gustavo Faerman
Buenos Aires, Argentina

**********************************************************
Our class:

package ar.com.fys.basketball.coach.entidades;
import java.sql.Date;
import java.util.ArrayList;

public class Persona {
    private int ID_Persona;
    private String nombre;
    private String apellido;
    private Date fechaNacimiento;

    /**
     [EMAIL PROTECTED] aggregation
     *      @associates ar.com.fys.basketball.coach.entidades.Documento
     * @supplierCardinality 0..**/
    private ArrayList susDocumentos;
    private double peso;
    private double altura;

 
 
    public ArrayList getSusDocumentos(){ return susDocumentos; }
    public void setSusDocumentos(ArrayList susDocumentos){ 
this.susDocumentos = susDocumentos; }

Other getters and setters removed...
 
}

******************************************************
Stack Error

[PersistentField] ERROR: while set field: 
object class[ ar.com.fys.basketball.coach.entidades.Persona
target field: susDocumentos
target field type: class java.util.ArrayList
object value class: 
org.apache.ojb.broker.util.collections.RemovalAwareCollection
object value: [EMAIL PROTECTED], 
[EMAIL PROTECTED]
field type mismatch
[org.apache.ojb.broker.accesslayer.RsIterator] ERROR: Error setting 
field:susDocumentos in 
object:ar.com.fys.basketball.coach.entidades.Persona: field type mismatch
java.lang.IllegalArgumentException: field type mismatch


Reply via email to