[jboss-user] [EJB 3.0] - Re: Aliases in Queries

micho do-not-reply at jboss.com
Sat Feb 24 17:29:00 EST 2007


Thanks for your answer.

How do I have to name the property an a query in my example
@Column(name = "peter")
  |   public String getHugo()
  |   { return mHugo; }
  | 
peter, Hugo, mHugo
the doku says
The logical column name is defined by the Hibernate NamingStrategy implementation. The default EJB3 naming
  | strategy use the physical column name as the logical column name. Note that this may be different than the
  | property name (if the column name is explicit). Unless you override the NamingStrategy, you shouldn't worry
  | about that.
I understood that the pysical name is the name in the database, that´s wrong?

from User as u where (u.Hugo = :name)
throws the same exception
from User where (Hugo = :name)
throws a grammar exception.

The query, thats ok
"from User where (peter = :name)") .setParameter ("name", "y")  
retrieves all User Objects with paremater "peter" = "y"

How can I turn on the SQL debugging.



View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4021758#4021758

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4021758




More information about the jboss-user mailing list