This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes Getting exception while passing List<Long> from hibernate to Stored Procedure Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Getting exception while passing List<Long> from hibernate to Stored Procedure" Watch "Getting exception while passing List<Long> from hibernate to Stored Procedure" New topic
Author

Getting exception while passing List<Long> from hibernate to Stored Procedure

Deeps Mistry
Ranch Hand

Joined: Jan 31, 2009
Posts: 189
Hi,

I need to pass List<Long> from hibernate to my stored procedure. Below is the code for the same -

Here is my query -



My stored procedure looks like this -


The exception is get is -


Is there something wrong with my stored procedure or the way i am passing the List to my stored procedure?

Thanks.

Bogdan Baraila
Ranch Hand

Joined: May 23, 2011
Posts: 43
I think that the problem my be in how you are using the NUMBER data type. If you are using oracle then you should use something like this: NUMBER(p) or INTEGER or LONG (BLOB). Here it is the description of NUMBER. As you can see if it's used like in your function then it will basically expect a list of floats.
The NUMBER datatype
Stores zero, positive, and negative numbers, fixed or floating-point numbers

Fixed-point NUMBER
NUMBER(p,s)
precision p = length of the number in digits
scale s = places after the decimal point, or (for negative scale values) significant places before the decimal point.

Integer NUMBER
NUMBER(p)
This is a fixed-point number with precision p and scale 0. Equivalent to NUMBER(p,0)

Floating-Point NUMBER
NUMBER
floating-point number with decimal precision 38
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Getting exception while passing List<Long> from hibernate to Stored Procedure
 
Similar Threads
I want to use List<String> in JPQL syntaxis
Access a property from a collection in Hibernate
Stored Procedure inside HQL query?
Execute Multiple SQL Queries in PL/SQL Procedure based on parameter
CallableStatement Error on Oracle Stored Procedure.