Clob e JPA  XML
Índice dos Fóruns » Java Enterprise Edition (Java EE)
Autor Mensagem
Rafael Nunes
Moderador
[Avatar]

Membro desde: 09/10/2003 13:41:06
Mensagens: 2890
Localização: sao bernardo do campo
Offline

Buenas,
Tô tentando utilizar Clob no JPA mas tô tomando uma pequena surra.

Setei a anotação @Lob no campo.(Depois de algumas tentativas ainda coloquei a propriedade: 'SetBigStringTryClob' no meu datasource, mas nem assim funcionou, segue o erro que me retorna:


------------------------------------------------------------------
"Think different? I'd be happy if most people would just think..."

http://www.yaw.com.br
http://twitter.com/rafanunes
http://twitter.com/youandwe
[Email]
sapulha
JavaTeenager
[Avatar]

Membro desde: 18/07/2006 08:10:20
Mensagens: 180
Localização: São Bernardo do Campo
Offline

Rafael, qual o tipo da sua propriedade e qual banco de dados está usando ?

"Se não for, não é! Mais se for, pode ser que não seja!"

Sun Certified Java Programmer For The Java 5
thingol
Moderador

Membro desde: 29/07/2004 16:10:13
Mensagens: 17543
Offline

Se estiver usando o Oracle e o Toplink (ou o Toplink Essentials, que é o que vem com o Glassfish), veja o artigo:

http://www.oracle.com/technology/products/ias/toplink/jpa/resources/toplink-jpa-annotations.html


@Lob

By default, a JPA persistence provider assumes that all persistent data can be represented as typical database data types.

Use the @Lob annotation with the @Basic mapping to specify that a persistent property or field should be persisted as a large object to a database-supported large object type.

A Lob may be either a binary or character type. The persistence provider infers the Lob type from the type of the persistent field or property.

For string and character-based types, the default is Clob. In all other cases, the default is Blob.

You can also use the @Column attribute columnDefinition to further refine the Lob type.

This annotation has no attributes. For more details, see the API.

Example 1-46 shows how to use this annotation to specify that persistent field pic should be persisted as a Blob.

Example 1-46 @Lob

[WWW]
Rafael Nunes
Moderador
[Avatar]

Membro desde: 09/10/2003 13:41:06
Mensagens: 2890
Localização: sao bernardo do campo
Offline

thingol wrote:Se estiver usando o Oracle e o Toplink (ou o Toplink Essentials, que é o que vem com o Glassfish), veja o artigo:


Oracle, Hibernate e Jboss na verdade.

Sapulha:
É uma String, tô usando o Oracle 10g. (É a mesma treta que o Bulhulha tá vendo contigo...hehe)
[Email]
sapulha
JavaTeenager
[Avatar]

Membro desde: 18/07/2006 08:10:20
Mensagens: 180
Localização: São Bernardo do Campo
Offline

Hehehe, blz. Tô vendo aqui, qualquer coisa vai via MSN

"Se não for, não é! Mais se for, pode ser que não seja!"

Sun Certified Java Programmer For The Java 5
Rafael Nunes
Moderador
[Avatar]

Membro desde: 09/10/2003 13:41:06
Mensagens: 2890
Localização: sao bernardo do campo
Offline

Achamos aqui, o problema era a versão do drive ojdbc14.

Bregado aí.

------------------------------------------------------------------
"Think different? I'd be happy if most people would just think..."

http://www.yaw.com.br
http://twitter.com/rafanunes
http://twitter.com/youandwe
[Email]
Bart
Smalltalk

Membro desde: 25/05/2007 16:45:29
Mensagens: 1
Offline

Olá Rafael, blz !

Sobre o problema com Clob e a versão jdbc1.4, qual foi a solução ?


Obrigado.
 
Índice dos Fóruns » Java Enterprise Edition (Java EE)
Ir para:   
Powered by JForum 2.1.8 © JForum Team