parameter « Exception « JPA Q&A





1. hibernate & statement parameter 1 not set error    coderanch.com

Hi all, just wondering if anyone can shed some light on this problem... Trying to create a persistant object (a User) but when I execute the session .get() method the exception that comes back is a java.sql.exception of "Statement parameter 1 not set"). From looking at the output it looks like the value I'm passing in the .get() is not being ...

2. JPQL - org.hibernate.QueryParameter Exception: could not locate named parameter    coderanch.com

I am trying to execute two JPQL queries in an EJB3 application deployed on a JBoss 4.2.2.GA. The code looks as follows: String queryString1 = "select sub from Subscription sub where sub.itemPattern in (select ip from ItemPattern ip where ip.caption = :c)"; List queryResultList = em.createQuery(queryString1).setParameter("c", "myCaption").getResultList(); String queryString2 = "select itm from green20.demo.items.Item itm where itm.persistenceID = :p "; List ...

3. Invalid Parameter index exception    forum.hibernate.org

Author Message liushuai Post subject: Invalid Parameter index exception Posted: Wed Jun 16, 2004 5:33 pm Newbie Joined: Wed May 12, 2004 2:57 pm Posts: 17 Hi all, I try to do a query like this Code: StringBuffer sb = new StringBuffer(); sb.append(SELECT_ALL); sb.append(" where procedurecategory.procedure = ? AND procedurecategory.parentCategory IS NULL"); objs = session.find(sb.toString(), obj, Hibernate.OBJECT); and I ...

4. error with named parameter in elements function    forum.hibernate.org

I have an HQL query that looks like this: With the following code using it below: public List getUsersByUserNames(List userNames) throws DAOException { List users = null; if(userNames!=null) { String[] paramNames = {"userNames"}; Object[] paramValues = {userNames}; Type[] typeParams = {Hibernate.SERIALIZABLE}; users = getHibernateTemplate(). findByNamedQuery( "com.rsm.dao.hibernate.UserDAOHibernate.users.by.userNames", paramNames, paramValues, typeParams); } return users; ...

5. Parameter index out of range error    forum.hibernate.org

Hi I get the error "java.sql.SQLException: Parameter index out of range (3 > 2)." when i try to save the code below, is there something missing from the many-to-one or one-to-many tag, i have tried cascade and it still doesnt work, it seems that it does not like the many-to-one tag in DDETAILS, because when i take that out it saves ...

6. Missing IN or OUT parameter at index 6 error    forum.hibernate.org

Author Message mromiti2 Post subject: Missing IN or OUT parameter at index 6 error Posted: Mon Feb 06, 2006 5:44 pm Newbie Joined: Tue Jan 24, 2006 11:56 am Posts: 15 Need help with Hibernate? Read this first: http://www.hibernate.org/ForumMailingli ... AskForHelp Hibernate version: 3.1.1 Mapping documents: ------------- Person ------------

7. ClobImpl parameter error    forum.hibernate.org

Dear all, I'm trying to use a Clob with Hibernate. I found an example saying to use the Hibernate.createClob method in order to create a Clob. I've found that the version of the method with 2 parameters wants an int value as number of characters in the stream. Looking at the source code I've found that this int parameter is used ...

8. Error : Parameter uname does not exist as a named parameter    forum.hibernate.org

Hello everybody I get an error after deploy a war file in Oracle OAS 10g (10.1.3.10). I am using spring and hibernate 3.0. The database is Oracle 10. If i deploy it in jboss 4.0.2 it works fine but when I deploy in Oracle OAS 10g (10.1.3.10) and try to access the data base i have the next error I send ...

9. NamedQuery parameter error    forum.hibernate.org

I have a named query:- @NamedQueries ( { @NamedQuery(name="byOwners", query="select e from SchedulerEntry e where e.owner.id in ( :loginIdList )") }) I am calling it like this:- public List findEntriesFor(List owners) { Query query = getCurrentSession().getNamedQuery("byOwners"); query.setParameter("loginIdList", loginIds); List result = query.list(); return result; } I get this error:- Caused by: java.lang.ClassCastException: java.util.ArrayList cannot be cast to java.lang.Long at org.hibernate.type.LongType.set(LongType.java:42) at ...