Register / Login
this forum made possible by our volunteer staff, including ...
Stephan van Hulst
Object Relational Mapping
HQL Group different tables?
posted 4 years ago
Im pretty new to databases, and programming in general, i tried everything but could not come up with a solution, my problem is: I have 2 tables in my database:
in my Cars table i have 3 columns:
*modelID *carName *carsSold
and the Model table has 3 columns:
*modelID *modelName *modelYear
Now my program has a button that says Group by Model, when the user clicks it has to show the information grouped by the Model, like:
Model ID : 1022
Model Name: Audi
Car Name: A3
Cars sold: 120
Everything is ready, im just lost at the HQL query, i know i have to change something in the mapping to one-to-many or many-to-many but i have do idea where and wich one
It is sorta covered in the
JavaRanch Style Guide
Boost this thread!
PreparedStatement to pass user input to MySQL not working
joining two tables into one database table
Bind a multple InputText values into HashMap<String,ArrayList<Integer>> in JSF
Showing column numbers in HTML page.