Duplicated entities in a one-to-many select

Description

Using a criteria to obtain a full select on an class that has a one-to-many eager property returns duplicated entities.
It seems it's making the returned list to have the same size of the result set returned by the join necessary to fetch the rows.

Here's the code I'm executing:

Session sessao = getSession();
try {
Criteria criterio = sessao.createCriteria(TipoErro.class);
return criterio.list();
} finally {
releaseSession(sessao);
}

And here's the mapping of the one-to-many property:

<set name="emailsNotificacao" inverse="true" lazy="false" fetch="join">
<key column="ID_TIPO_ERRO" not-null="true" />
<one-to-many
class="com.matera.inss.entity.EmailNotificacao" />
</set>

I'll attach both the mapping of the parent entity, and of the child entity (don't know if it might help).

Changing the use of the criteria by a find("from TipoErro") works perfectly.

There's already a topic opened on the forum about this same issue, with more details and examples.
Here's the topic: http://forum.hibernate.org/viewtopic.php?t=955186

Thank you very much,
Tiago.

Environment

Oracle

Status

Assignee

Unassigned

Reporter

Tiago Rinck Caveden

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Minor
Configure