I'm using Hibernate's getHibernateTemplate().findByNamedQuery() in order to execute a stored procedure in SQL Server (for optimization reasons). The stored proc is supposed to return a List of Longs.
From what I can see, the only way I can return such a list is to create a wrapper class specifically for Hibernate, and use this in part of my @NamedNativeQuery declaration: resultClass=LongWrapper.class
Is this really the only way to return a list of longs using Hibernate's findByNamedQuery() function?
Thing is, I need to optimize memory allocation and performance, as the stored procedure will return close to a million longs, so I'm reluctant wrap already-wrapped Longs into my own wrapper class. Seems like unnecessary overhead.
Any suggestions?
Thank you in advance!!