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

php - Submit Form Data without Reloading page -

linux - Rails running on virtual machine in Windows -

php - $params->set Array between square bracket -