-->
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: Implementing a "SQLFunction" that returns a "Long[]".
PostPosted: Sat Jun 11, 2016 1:07 pm 
Newbie

Joined: Wed Aug 14, 2013 6:10 am
Posts: 2
Hello:

I want to create a class that implements the "org.hibernate.dialect.function.SQLFunction" interface and that returns an array of "Longs" ("Long[]") when it's executed. The "SQLFunction" interface seems to be easy to understand. However, I'm having a hard time creating a custom type that represents that array.

I've read the documentation and some guides, and they recommend to use the "org.hibernate.usertype.UserType" interface instead of "org.hibernate.type.Type", because it's more simple, easier to understand and less subject to changes in the future. However the method "SQLFunction.getReturnType" only accepts "Type" as the return type, not "UserType".

So, Is there a way to create a "Type" from an "UserType"? Or will I need to implement my custom type from the "Type" interface?

Thank you.


Top
 Profile  
 
 Post subject: Re: Implementing a "SQLFunction" that returns a "Long[]".
PostPosted: Mon Jun 13, 2016 3:42 am 
Hibernate Team
Hibernate Team

Joined: Thu Sep 11, 2014 2:50 am
Posts: 1628
Location: Romania
I think you need to create a new Type and register it so that Hibernate knows it. If it's a general purpose solution, you can send a Pull Request to integrate it hibernate-core.


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.