Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JPA Query using parameter not working

Emiliano Viscarra
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have this Query:

Query query = getEntityManager().createQuery("FROM CUsuario alias WHERE alias.apellido LIKE :apellido");
query.setParameter("apellido","%" + apellido + "%");

And if I debug I get an EJBSecurityManager error.

If I change the parameter for the attribute it works well.

It's like it can't accept a parameter.

The most weird thing is that we are working in a group of three and my two other partners have the same code but it works well for them.

I'm Using Eclipse 3.4.1 with Glassfish 2.1 and Struts2. Any ideas?
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!