Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General forum!

Eugene Shaforostov

Greenhorn
+ Follow
since Aug 11, 2007
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Eugene Shaforostov

Thanks, this query works fine.
But I want to understand how use association mappings.
Mapping files should looks like this?
News.hbm.xml



Users.hbm.xml


If it`s right then what query will return required result?
Thanks, Edvins, I already read this reference, but the question remains.

Mapping for table News
News.hbm.xml



Mapping for table Users
Users.hbm.xml
I have two tables



I need to join this tables by News.author_id and Users.id.
When I trying to query

I get the following error:
QuerySyntaxException: Path expected for join!

Please help me to resolve this problem.
Thanks in advance for any help.
Thank you!
Now everything works without any problem.
Hi Jaikiran,
Thanks for your reply.
I`m change the declaration like you said, but now I get error while compiling:
Exception in thread "main" org.hibernate.HibernateException: Dialect class not found: net.sf.hibernate.dialect.MySQLDialect
I have a simple test application using Hibernate and MySQL.
I got this error when I was trying to run project:


The project content below files
hibernate.properties


Product.hbm.xml


Product.java


InsertProduct.java


All files be found in one package.

What's wrong?
[ August 12, 2007: Message edited by: Eugene Shaforostov ]