Pre Exam Test Practice (SSC | Banking | IAS | GATE | State Level | CLAT | Railways | Insurance | Teaching Exams | NDA | Defence | IES |State Exam )

Organizational Research By

Surprising Reserch Topic

using inner join criteria language using -'hibernate-criteria'

using inner join criteria language  using -'hibernate-criteria'

Have two tables : Rating and Books. Rating table has foreign key to the Books table.

These tables are mapped this way :

Books :

 HasMany(x => x.RatingList).Cascade.All().Inverse();      

and the Rating table :

 References(x => x.Books).Column("BookId").Cascade.All();

Have this :

var bks = session.CreateCriteria("Books", "b");

using this restriction for selecting books


here is the problem, how to join Rating table ??

                    bks.CreateAlias("b.Rating", "c");

                    return PartialView("/Views/Home/_Books.cshtml", bks);

The final result i need is to select all Books but also Rating for them.

Some help ?

asked Sep 7, 2015 by rajesh
0 votes

Related Hot Questions

Government Jobs Opening