java - Retrieving attributes from another table using HQL -


i using spring-mvc project. have classes follows:

pseudo code:

public class a{    @onetomany(fetchtype.eager)    private set<classb> classb;    public set<productbasic> getproductbasic(){return productbasic;}    // have setter above } 

for class , class b in database, have foreign of 'class a' 'id' in 'class b'. using hql want retrieve data class , class b , display it. have class b primary key , access both tables. how shall proceed using hibernate query language.

as have mapping of both table using following simple query data of both table. here set of classb's data each classa object.

//    session session session object string hql = "from a"; query query = session.createquery(hql); list results = query.list(); 

Comments

Popular posts from this blog

Python Kivy ListView: How to delete selected ListItemButton? -

asp.net mvc 4 - A specified Include path is not valid. The EntityType '' does not declare a navigation property with the name '' -