Pessoal, o meu mapeamento com hibernate esta apresentando erro:
Error que aparece no console:...
21:48:38,496 DEBUG AbstractEntityPersister:2756 - Delete 0: /* delete model.Pessoa */ delete from pessoa where id=?
01/11/2008 21:48:38 org.apache.catalina.core.ApplicationDispatcher invoke
SEVERE: Servlet.service() for servlet jsp threw exception
org.hibernate.PropertyNotFoundException: Could not find a getter for turmas in class model.Aluno
at org.hibernate.property.BasicPropertyAccessor.createGetter(BasicPropertyAccessor.java:282)
at org.hibernate.property.BasicPropertyAccessor.getGetter(BasicPropertyAccessor.java:275)
at org.hibernate.mapping.Property.getGetter(Property.java:272)
...
classe aluno:
public class Aluno extends Pessoa implements Serializable{
private String matricula;
private Collection turmas;
...
metodos get e set
...
<hibernate-mapping package="model">
<joined-subclass name="Aluno" extends="Pessoa" table="aluno">
<key column="pessoa_id" />
<property name="matricula" />
<set name="turmas" table="turma_has_aluno">
<key column="aluno_pessoas_id" />
<many-to-many class="Turma" column="turma_id" />
</set>
</joined-subclass>
</hibernate-mapping>
public class Turma implements Serializable{
private int id;
private String nome;
private Disciplina disciplina;
private Professor professor;
private Collection alunos;
...
metodos get e set
...
<hibernate-mapping package="model">
<class name="Turma" table="turma">
<id name="id" column="id">
<generator class="native">
<param name="sequence">seq_turma</param>
</generator>
</id>
<property name="nome"></property>
<many-to-one name="professor" class="Professor"
column="professor_pessoa_id" />
<many-to-one name="disciplina" class="Disciplina"
column="disciplina_id" />
<set name="alunos" table="aluno_has_turma">
<key column="turma_id" />
<many-to-many class="Aluno" column="aluno_pessoa_id"></many-to-many>
</set>
</class>
</hibernate-mapping>
CREATE TABLE Aluno (
Pessoa_id INTEGER UNSIGNED NOT NULL,
matricula VARCHAR(255) NULL,
PRIMARY KEY(Pessoa_id),
FOREIGN KEY(Pessoa_id)
REFERENCES Pessoa(id)
ON DELETE NO ACTION
ON UPDATE NO ACTION
);
CREATE TABLE Turma (
id INTEGER NOT NULL default nextval('seq_turma'),
Disciplina_id INTEGER NOT NULL,
Professor_Pessoa_id INTEGER NOT NULL,
nome VARCHAR(255) NULL,
PRIMARY KEY(id),
FOREIGN KEY(Professor_Pessoa_id)
REFERENCES Professor(Pessoa_id)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
FOREIGN KEY(Disciplina_id)
REFERENCES Disciplina(id)
ON DELETE NO ACTION
ON UPDATE NO ACTION
);
CREATE TABLE Turma_has_Aluno (
Turma_id INTEGER NOT NULL,
Aluno_Pessoa_id INTEGER NOT NULL,
PRIMARY KEY(Turma_id, Aluno_Pessoa_id),
FOREIGN KEY(Turma_id)
REFERENCES Turma(id)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
FOREIGN KEY(Aluno_Pessoa_id)
REFERENCES Aluno(Pessoa_id)
ON DELETE NO ACTION
ON UPDATE NO ACTION
)
Esses codigo e o do exemplo do tutorial hibernate 3 do proprio GUJ. Esse error acontence quando eu vou utilizar uma pagina jsf para criar um novo curso(O error não é com o mapeamento do curso, pois só dá esse error quando eu adiciono o mapeamento NxN de aluno com turma).
Alguem poderia olhar se encontra algum erro?