-->
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.  [ 6 posts ] 
Author Message
 Post subject: Query.list() throws NullPointerException in Hibernate 5.0.7
PostPosted: Thu Mar 09, 2017 3:05 am 
Newbie

Joined: Thu Mar 09, 2017 2:59 am
Posts: 3
Hi All,

I'm facing a NullPointerException in Hibernate 5.0.7 since I added the following line in a custom Dialect class overriding from SQLServerDialect.

Code:
registerHibernateType(Types.NCHAR, "char(1)");


Is there any alternative way to do this?

used query is

Code:
SELECT MULTI_GAME FROM ASSET.ASSET_CONFIGURATION_OPTION


Code:
null: java.lang.NullPointerException at org.hibernate.loader.custom.ScalarResultColumnProcessor.extract(ScalarResultColumnProcessor.java:54) at org.hibernate.loader.custom.ResultRowProcessor.buildResultRow(ResultRowProcessor.java:83) at org.hibernate.loader.custom.ResultRowProcessor.buildResultRow(ResultRowProcessor.java:60) at org.hibernate.loader.custom.CustomLoader.getResultColumnOrRow(CustomLoader.java:414) at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:756) at org.hibernate.loader.Loader.processResultSet(Loader.java:972) at org.hibernate.loader.Loader.doQuery(Loader.java:930) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:336) at org.hibernate.loader.Loader.doList(Loader.java:2611) at org.hibernate.loader.Loader.doList(Loader.java:2594) at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2423) at org.hibernate.loader.Loader.list(Loader.java:2418) at org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:336) at org.hibernate.internal.SessionImpl.listCustomQuery(SessionImpl.java:1967) at org.hibernate.internal.AbstractSessionImpl.list(AbstractSessionImpl.java:322) at org.hibernate.internal.SQLQueryImpl.list(SQLQueryImpl.java:125)


Kindly help on the above issue and let us know in case of any alternative way is there. Thanks in advance.


Top
 Profile  
 
 Post subject: Re: Query.list() throws NullPointerException in Hibernate 5.0.7
PostPosted: Thu Mar 09, 2017 4:15 am 
Hibernate Team
Hibernate Team

Joined: Thu Sep 11, 2014 2:50 am
Posts: 1628
Location: Romania
If you debug it, it's the type variable that's null? Or is it something else?


Top
 Profile  
 
 Post subject: Re: Query.list() throws NullPointerException in Hibernate 5.0.7
PostPosted: Thu Mar 09, 2017 5:39 am 
Newbie

Joined: Thu Mar 09, 2017 2:59 am
Posts: 3
Thanks for your earliest reply see below my comments.

Yes, when i debug type variable that's null and also observed basic(typeName) method had been searched for NCHAR class not available at run time hibernate framework it self doesn't have that StanderdBasicType constants.

let me know in case more details needed.


Top
 Profile  
 
 Post subject: Re: Query.list() throws NullPointerException in Hibernate 5.0.7
PostPosted: Thu Mar 09, 2017 6:30 am 
Hibernate Team
Hibernate Team

Joined: Thu Sep 11, 2014 2:50 am
Posts: 1628
Location: Romania
SqlServerDialect is a base class. What if you extend from SQLServer2012Dialect instead?


Top
 Profile  
 
 Post subject: Re: Query.list() throws NullPointerException in Hibernate 5.0.7
PostPosted: Thu Mar 09, 2017 7:37 am 
Newbie

Joined: Thu Mar 09, 2017 2:59 am
Posts: 3
My class is extended only SQLServer2012Dialect


Top
 Profile  
 
 Post subject: Re: Query.list() throws NullPointerException in Hibernate 5.0.7
PostPosted: Thu Mar 09, 2017 7:40 am 
Hibernate Team
Hibernate Team

Joined: Thu Sep 11, 2014 2:50 am
Posts: 1628
Location: Romania
If you can provide a replicating test case, then you should open a Jira issue.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 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.