-->
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.  [ 4 posts ] 
Author Message
 Post subject: UserType as native search parameter
PostPosted: Sat May 19, 2007 12:54 pm 
Hi,

I have a pl/sql stored procedure in oracle 10 that I am calling from a named query using an EntityManger (the version in jboss 4.2 ga).

One of the parameters the stored procedure takes is a VARRAY.

I have a (crude) UserType that handles the Oracle ARRAY object I build to use as the VARRAY parameter.

If I create the query using the entity manager and then do:

Code:
org.hibernate.Query underlyingHbmQuery = ((QueryImpl)namedQry).getHibernateQuery();
underlyingHbmQuery.setParameter("paramName", oraArray, vArrayType);


Then everything works fine :)

If, however I just try to set the varray parameter using query.setParameter("name", object) then I get a strange oracle "not serializable" exception...

The VARRAY is not a property on any of my entities.

I can't find any way of registering a UserType with the EntityManger (or related EntityManagerFactory) - as I would using a <typedef> element in a hibernate mapping file.

Does anyone have any suggestions?

Thanks,

Andy


Top
  
 
 Post subject:
PostPosted: Tue May 22, 2007 6:28 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
I thought Hibernate would guess the user type. But there seems to be some limits in Steve's AST spells.
Since JPA does not define the notion of user type, there is no other workaround, sorry.

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 23, 2007 4:00 am 
Not to worry, the code is working as-is.

Thanks for getting back to me.

Cheers,

Andy


Top
  
 
 Post subject:
PostPosted: Fri Jun 22, 2007 10:10 am 
Newbie

Joined: Mon Apr 16, 2007 2:05 pm
Posts: 5
I didn't made any changes and the code seems to be fine. What is your add?

_________________
search engine placement


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.