First, it forgives for my English.  My problem the following one: 

I have a mapping many-to-many between the class Usuario and Turma. 

The Usuario class has an ArrayList of Turma and the class Turma has an ArrayList of Usuario.

 

This mapping this functioning correctly.

My problem and that I want to know if a usuario belongs to a group, or either, if it this inside of this arrayList.

I tried you vary querys and I no obtain to catch the usuario of this inside arraylist by id. help me?

I tried of you vary ways, as this: 

select u from br.uece.casulo.persistence.entity.Usuario u where u

IN LIST ( select t.usuarios from br.uece.casulo.persistence.entity.Turma t )

and u.id = $1



Yahoo! Mail - Participe da pesquisa global sobre o Yahoo! Mail. Clique aqui!
=======================================

public class Turma implements ITurma {

      private long id;
..
      private ArrayList usuarios = new ArrayList();
..
}
======================================
public class Usuario implements IUsuario,HttpSessionBindingListener {
      private int id;
..
      private ArrayList turmas = new ArrayList();
..
}
======================================

PART OF MAPPING
    <!-- Usuario -->
    <class identity="id" key-generator="MAX" 
name="br.uece.casulo.persistence.entity.Usuario">

        <cache-type type="none" />
        <map-to table="usuario"/>
        <field name="id" type="integer">
            <sql name="id"/>
        </field>
..
       <field name="turmas" type="br.uece.casulo.persistence.entity.Turma" 
collection="arraylist">
                  <sql name="turma_id" many-table="aluno" many-key="usuario_id"/>
            </field>
    </class>

    <!-- Turma -->
    <class name="br.uece.casulo.persistence.entity.Turma" identity="id" 
key-generator="MAX">
        <cache-type type="none" />
        <map-to table="turma" />
       <field name="id" type="long">
           <sql name="id" />
       </field>
        <field name="usuarios" type="br.uece.casulo.persistence.entity.Usuario" 
collection="arraylist">
           <sql name="usuario_id" many-table="aluno" many-key="turma_id"/>
       </field>
    </class>
----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to