Problemas com relacionamento em Hibernate

Olá pessoal! esttou com difiuldades no hibernate, naum consigo fazer um relacionamento de um-pra-muitos, vou explicar a situacao:

tenho duas tabelas: tx_texto e tx_texto_lingua, a tabela tx_texto tem um marcador, e a tabela tx_texto_lingua tem os textos traduzidos, ou seja, um texto tem varios tx_texto_lingua, eu fiz o seguinte mapeamento:

[quote]<class name=“bean.Texto” table=“tx_texto”>

	&lt;id name="id" column="id_texto"&gt;
        &lt;generator class="identity"/&gt;
    &lt;/id&gt;
    &lt;many-to-one class="bean.Modulo" column="id_modulo" name="modulo" cascade="all"/&gt; 
    &lt;bag name="traducao" lazy="true" inverse="true" cascade="all"&gt;
        &lt;key column="id_texto"/&gt;
        &lt;one-to-many class="bean.TextoLingua"/&gt;
    &lt;/bag&gt;
    &lt;property name="texto"		type="string"		column="vc_texto"/&gt;
    &lt;property name="cadastro"	type="timestamp"	column="dt_cadastro"/&gt;
    &lt;property name="revisao"	type="timestamp"	column="dt_revisao"/&gt;
&lt;/class&gt;[/quote]

e quero frizar de que eu testei os objetos individualmente e eles estao ok, s´´o naum consigo carregar a lista de objetos TextoLingua dentro de Texto!! Pois acontece o seguinte erro:

[quote]Exception in thread “main” org.hibernate.exception.GenericJDBCException: could not initialize a collection: [bean.Texto.traducao#1]
at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.loader.Loader.loadCollection(Loader.java:2001)
at org.hibernate.loader.collection.CollectionLoader.initialize(CollectionLoader.java:36)
at org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:565)
at org.hibernate.event.def.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:60)
at org.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:1716)
at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:344)
at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:86)
at org.hibernate.collection.AbstractPersistentCollection.readSize(AbstractPersistentCollection.java:109)
at org.hibernate.collection.PersistentBag.size(PersistentBag.java:225)
at teste.TesteRelacionamento.main(TesteRelacionamento.java:34)
Caused by: java.sql.SQLException: [Microsoft][ODBC SQL Server Driver]Índice de descritor inválido
at sun.jdbc.odbc.JdbcOdbc.createSQLException(Unknown Source)
at sun.jdbc.odbc.JdbcOdbc.standardError(Unknown Source)
at sun.jdbc.odbc.JdbcOdbc.SQLGetDataInteger(Unknown Source)
at sun.jdbc.odbc.JdbcOdbcResultSet.getDataInteger(Unknown Source)
at sun.jdbc.odbc.JdbcOdbcResultSet.getInt(Unknown Source)
at sun.jdbc.odbc.JdbcOdbcResultSet.getInt(Unknown Source)
at org.hibernate.type.IntegerType.get(IntegerType.java:28)
at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:163)
at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:154)
at org.hibernate.persister.collection.AbstractCollectionPersister.readKey(AbstractCollectionPersister.java:734)
at org.hibernate.loader.Loader.readCollectionElement(Loader.java:975)
at org.hibernate.loader.Loader.readCollectionElements(Loader.java:646)
at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:591)
at org.hibernate.loader.Loader.doQuery(Loader.java:701)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
at org.hibernate.loader.Loader.loadCollection(Loader.java:1994)
… 9 more[/quote]

[]s.

Por favor gente…ningûém sabe o que pode ser?

[]s

provavelmente o erro:
Exception in thread “main” org.hibernate.exception.GenericJDBCException: could not initialize a collection: [bean.Texto.traducao#1]

veja se esta mapeado corretamente.

T+

ops desculpe
aqui:

mas oq esta errado? me ajudem eu naum sei mais oq fazer!!
mapeei a seguinte classe com o mapeamento abaixo:

[code]package bean;

import java.util.Date;
import java.util.List;

public class Texto {

private int id;
private Modulo modulo;
private String texto;
private Date cadastro;
private Date revisao;
private List&lt;TextoLingua&gt; traducao;

public List&lt;TextoLingua&gt; getTraducao() {
	return traducao;
}

public void setTraducao(List&lt;TextoLingua&gt; traducao) {
	this.traducao = traducao;
}

public int getId() {
	return id;
}

public void setId(int id) {
	this.id = id;
}

public Modulo getModulo() {
	return modulo;
}

public void setModulo(Modulo modulo) {
	this.modulo = modulo;
}

public String getTexto() {
	return texto;
}

public void setTexto(String texto) {
	this.texto = texto;
}

public Date getCadastro() {
	return cadastro;
}

public void setCadastro(Date cadastro) {
	this.cadastro = cadastro;
}

public Date getRevisao() {
	return revisao;
}

public void setRevisao(Date revisao) {
	this.revisao = revisao;
}

}[/code]

[]s

pessoal, desculpa eu estar sendo chato mas é que estou parado nisso faz muito tempo e o pior que os exemplos que vejo naum tem diferença… alguem pode passar alguma coisa, um link que seja facil…pq estou realmente necessitado!!!

[]s

digita no google: “gary’s blog” hibernate

lá tem uns pdfs bem legais que explicam sobre muitas coisas do hibernate!!

Obrigado! Muito bom mesmo! Vou estudar e tentar hoje em casa!!! :lol:

[]s

Pessoal, descobri, a zica é o SQL Server 2000…não sei pq…se é versão de é update mas eu exportei meu banco pro ACCESS depois importei ele pro MySql e com o MESMO codigo ele funcionou de PRIMEIRA…é uma pena, o SQL Server é muito mais facil de mexer…mas comecarei a mexer no MySql mesmo!! fica ae a dica!!!

[]s e obrigado pelos posts!!