tags:

views:

13

answers:

1

I have 2 entities:

article
category

then a table:

articles_categories
- articleID
- categoryID

I only have mappings for article and category, and no relationships have been setup as of yet.

Is it possible to build a query to get all articles that are in categoryID=234 ?

+1  A: 

No, it's not possible (using HQL queries). If article contained a categoryID field then you would be able to do it, but with a many-to-many relationship table, you'll need to set up the mappings.

It might be possible if you use a native query. But setting up the relationship is the proper thing to do.

Kaleb Brasee