0

hibernate join query

asked 2015-09-11 12:04:14 +0800

aliabbas gravatar image aliabbas
1 1

Hi , I am facing a a problem using zkoss with hibernate

I have Two models one is JuvenileInfo other is SchoolMeasure

In SchoolMeasure I have created a manyToOne relationship

@Transient @ManyToOne @JoinColumn(name = "juvenile_id", nullable = false) public JuvenileInfo juvenile;

When I access

SessionFactory sessionFactory = new Configuration().configure() .buildSessionFactory();

Session session = sessionFactory.openSession(); session.beginTransaction(); List<shoolbasedmeasure> result1 = session.createQuery( "from ShoolBasedMeasure e inner join e.juvenile ") .list();

I got error juvenile is not property , So anyone can help me how I get parent record list view to show its any column

delete flag offensive retag edit

2 Answers

Sort by ยป oldest newest most voted
0

answered 2015-09-12 02:48:54 +0800

onsir gravatar image onsir
132 2

in from ShoolBasedMeasure e inner join e.juvenile try change inner join to Join

link publish delete flag offensive edit
0

answered 2015-09-13 15:19:58 +0800

Darksu gravatar image Darksu
1991 1 4

Hello aliabbas,

For more information please refer to the following url, and chapter 14.3 Associations and joins:

https://docs.jboss.org/hibernate/orm/3.3/reference/en/html/queryhql.html

Best Regards,

Darksu

link publish delete flag offensive edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
1 follower

RSS

Stats

Asked: 2015-09-11 12:04:14 +0800

Seen: 37 times

Last updated: Sep 13 '15

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More