Greetings, everyone.
I'm having a problem retrieving the values of an entity from the database. I'm using the following mapping:
Code:
<hibernate-mapping schema="balcomMessenger" auto-import="true">
<class
name="br.com.balcom.messenger.bean.Mensagem"
table="MENSAGEM"
lazy="false">
<id name="id" type="integer" column="ID">
<generator class="native">
</generator>
</id>
<property
name="altaPrioridade"
column="ALTA_PRIORIDADE"
type="boolean"
/>
<property
name="assunto"
column="ASSUNTO"
type="string"
/>
<property
name="conteudo"
column="CONTEUDO"
type="text"
/>
<many-to-one
name="remetente"
class="br.com.balcom.messenger.bean.Pessoa"
column="ID_REMETENTE"
cascade="delete"
outer-join="auto"
access="property"
/>
<set
name="anexos"
table="ANEXO"
lazy="true"
order-by="ID_MENSAGEM desc">
<key column="ID_MENSAGEM" />
<one-to-many class="br.com.balcom.messenger.bean.Anexo" />
</set>
<set
name="destinatarios"
table="MENSAGEM_PESSOA"
lazy="false"
order-by="ID_MENSAGEM desc">
<key column="ID_MENSAGEM" />
<many-to-many column="ID_PESSOA" class="br.com.balcom.messenger.bean.Pessoa"/>
</set>
</class>
</hibernate-mapping>
When I access the properties of one "Mensagem" entity, via its Bean (Mensagem.java), I get the following messages in the logging:
Code:
DEBUG Loader:404 - result row: 1
DEBUG Loader:535 - Initializing object from ResultSet: 1
DEBUG Loader:604 - Hydrating entity: br.com.balcom.messenger.bean.Mensagem#1
11:20:39,140 DEBUG BooleanType:68 - returning 'true' as column: ALTA_PRI2_0_
11:20:39,140 DEBUG StringType:68 - returning 'Amigos, consegui!' as column: ASSUNTO0_
11:20:39,160 DEBUG JDBCExceptionReporter:36 - SQL Exception
com.mysql.jdbc.jdbc2.NotImplemented
at com.mysql.jdbc.jdbc2.ResultSet.getCharacterStream(Unknown Source)
at net.sf.hibernate.type.TextType.get(TextType.java:29)
at net.sf.hibernate.type.NullableType.nullSafeGet(NullableType.java:62)
at net.sf.hibernate.type.NullableType.nullSafeGet(NullableType.java:53)
at net.sf.hibernate.type.AbstractType.hydrate(AbstractType.java:66)
at net.sf.hibernate.loader.Loader.hydrate(Loader.java:610)
at net.sf.hibernate.loader.Loader.loadFromResultSet(Loader.java:551)
at net.sf.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:510)
at net.sf.hibernate.loader.Loader.getRow(Loader.java:425)
at net.sf.hibernate.loader.Loader.doQuery(Loader.java:208)
at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:132)
at net.sf.hibernate.loader.Loader.loadCollection(Loader.java:909)
at net.sf.hibernate.loader.Loader.loadCollection(Loader.java:884)
at net.sf.hibernate.loader.CollectionLoader.initialize(CollectionLoader.java:69)
at net.sf.hibernate.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:284)
at net.sf.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:3133)
at net.sf.hibernate.collection.PersistentCollection.forceInitialization(PersistentCollection.java:331)
at net.sf.hibernate.impl.SessionImpl.initializeNonLazyCollections(SessionImpl.java:3007)
at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:137)
at net.sf.hibernate.loader.Loader.doList(Loader.java:949)
at net.sf.hibernate.loader.CriteriaLoader.list(CriteriaLoader.java:109)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:3440)
at net.sf.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:177)
at br.com.balcom.messenger.BalcomMessenger.getPessoa(BalcomMessenger.java:76)
I have a bean called Pessoa (Person), which has a set of CaixaDeMensagens (something like MessageBox), and a CaixaDeMensagens has a set of Mensagem (Message). When I call BalcomMessenger.getPessoa, I'm retrieving this bean from the database via a hibernate session. I wonder if that's the property "conteudo" (contents) of the bean "Mensagem" that, by any reason, is not being able to be retrieved.
Please, help.
Best regards,
julioaragao