-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Does Hibernate OGM+Mongo @Lob works for Clob DataType?
PostPosted: Fri Nov 13, 2015 6:19 am 
Newbie

Joined: Fri Nov 13, 2015 12:19 am
Posts: 13
Hi,

Does hibernate OGM provide support for Clob DataType ? I got an Error while using @Lob on String field while Initializing SessionFactory - Caused by: org.hibernate.HibernateException: OGM000059: Unable to find a GridType for materialized_clob.

Hibernate version - hibernate-ogm-5.0.0.Alpha1
MongoDB - 3.0.4

PFB, is the stack trace

Code:

org.hibernate.MappingException: Could not get constructor for org.hibernate.ogm.persister.impl.SingleTableOgmEntityPersister
   at org.hibernate.persister.internal.PersisterFactoryImpl.createEntityPersister(PersisterFactoryImpl.java:123) ~[hibernate-core-5.0.0.Final.jar:5.0.0.Final]
   at org.hibernate.persister.internal.PersisterFactoryImpl.createEntityPersister(PersisterFactoryImpl.java:77) ~[hibernate-core-5.0.0.Final.jar:5.0.0.Final]
   at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:346) ~[hibernate-core-5.0.0.Final.jar:5.0.0.Final]
   at org.hibernate.ogm.boot.impl.OgmSessionFactoryBuilderImpl.build(OgmSessionFactoryBuilderImpl.java:54) ~[hibernate-ogm-core-5.0.0.Alpha1.jar:5.0.0.Alpha1]
   at com.imagine.app.util.ImagineSessionFactory.createNoSQLSessionFactory(ImagineSessionFactory.java:128) ~[ImagineSessionFactory.class:na]
   at com.imagine.app.util.ImagineSessionFactory.<clinit>(ImagineSessionFactory.java:44) ~[ImagineSessionFactory.class:na]
   at com.imagine.app.listener.ApplicationListener.contextInitialized(ApplicationListener.java:30) ~[ApplicationListener.class:na]
   at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5016) ~[catalina.jar:7.0.62]
   at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5528) ~[catalina.jar:7.0.62]
   at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) ~[catalina.jar:7.0.62]
   at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1575) ~[catalina.jar:7.0.62]
   at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1565) ~[catalina.jar:7.0.62]
   at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) ~[na:1.7.0_25]
   at java.util.concurrent.FutureTask.run(Unknown Source) ~[na:1.7.0_25]
   at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) ~[na:1.7.0_25]
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) ~[na:1.7.0_25]
   at java.lang.Thread.run(Unknown Source) ~[na:1.7.0_25]
Caused by: org.hibernate.HibernateException: OGM000068: Could not configure property com.ogm.mongodb.employers.Employee#name
   at org.hibernate.ogm.persister.impl.OgmEntityPersister.<init>(OgmEntityPersister.java:306) ~[hibernate-ogm-core-5.0.0.Alpha1.jar:5.0.0.Alpha1]
   at org.hibernate.ogm.persister.impl.SingleTableOgmEntityPersister.<init>(SingleTableOgmEntityPersister.java:34) ~[hibernate-ogm-core-5.0.0.Alpha1.jar:5.0.0.Alpha1]
   at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.7.0_25]
   at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) ~[na:1.7.0_25]
   at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) ~[na:1.7.0_25]
   at java.lang.reflect.Constructor.newInstance(Unknown Source) ~[na:1.7.0_25]
   at org.hibernate.persister.internal.PersisterFactoryImpl.createEntityPersister(PersisterFactoryImpl.java:96) ~[hibernate-core-5.0.0.Final.jar:5.0.0.Final]
   ... 16 common frames omitted
Caused by: org.hibernate.HibernateException: OGM000059: Unable to find a GridType for materialized_clob
   at org.hibernate.ogm.type.impl.TypeTranslatorImpl.getType(TypeTranslatorImpl.java:85) ~[hibernate-ogm-core-5.0.0.Alpha1.jar:5.0.0.Alpha1]
   at org.hibernate.ogm.persister.impl.OgmEntityPersister.<init>(OgmEntityPersister.java:303) ~[hibernate-ogm-core-5.0.0.Alpha1.jar:5.0.0.Alpha1]
   ... 22 common frames omitted



Top
 Profile  
 
 Post subject: Re: Does Hibernate OGM+Mongo @Lob works for Clob DataType?
PostPosted: Mon Nov 16, 2015 6:21 am 
Hibernate Team
Hibernate Team

Joined: Fri Sep 09, 2011 3:18 am
Posts: 295
Good catch,
the mapping of @Lob String will cause the exception, I'm working an a patch for this.

Note that @Lob byte[] will work.

Hope this help,
Davide


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.