-->
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: Hibernate annotation @Type(type = "true_false") not working
PostPosted: Wed Jan 14, 2015 12:46 am 
Newbie

Joined: Wed Jan 14, 2015 12:40 am
Posts: 2
Hi,

I have @Type hibernate annotation used in my entity class.
Code:
   @Type(type = "true_false")
   private Boolean isTrue;


But OGM does not seem to be supporting this resulting in following exception:
Code:
Caused by: org.hibernate.HibernateException: OGM000059: Unable to find a GridType for java.lang.Boolean
   at org.hibernate.ogm.type.impl.TypeTranslatorImpl.getType(TypeTranslatorImpl.java:100)
   at org.hibernate.ogm.persister.impl.OgmEntityPersister.<init>(OgmEntityPersister.java:272)
   ... 41 more


Is there any workaround that I can use?

Thanks,
Abhishek


Top
 Profile  
 
 Post subject: Re: Hibernate annotation @Type(type = "true_false") not working
PostPosted: Wed Jan 14, 2015 4:14 am 
Hibernate Team
Hibernate Team

Joined: Sat Jan 24, 2009 12:46 pm
Posts: 388
Hibernate OGM does not yet support the TrueFalseType. I've opened https://hibernate.atlassian.net/browse/OGM-716 for this. Would you be interested in contributing this feature?

Out of interest, why is it that you'd like to persist booleans in that way?

As far as workarounds are concerned, you could consider to make it an enum with TRUE and FALSE instead of a boolean (if it is just to get these values persisted in the datastore). Or, as a measure of last resort, you could fork the GridDialect implementation and override its overrideType() method. We're planning to enable support for custom types, but we are not there yet.

Htht

--Gunnar

_________________
Visit my blog at http://musingsofaprogrammingaddict.blogspot.com/


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.