Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #32141
| From | Arne Vajhøj <arne@vajhoej.dk> |
|---|---|
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: hibernate question (weird problem) |
| Date | 2015-07-25 15:22 -0400 |
| Organization | Aioe.org NNTP Server |
| Message-ID | <mp0nlu$ee6$1@speranza.aioe.org> (permalink) |
| References | <movjpe$tvk$1@speranza.aioe.org> |
On 7/25/2015 5:10 AM, Peter wrote:
> I am using hibernate, i got two class "JMPDATA" and "PARAMETER",
> they are linked together. Then I execute :
>
> session.createSQLQuery("SELECT a.* from JMPDATA").addEntity(JmpData.class);
>
> I didn't join table parameter, but i still able to get the value of it,
> why?
>
> iterator = query.list().iterator();
> while (iterator.hasNext()) {
> JmpData d = iterator.next();
> for (Parameter p : d.parameters) {
> System.out.println("\t" + p.name);
> }
> }
You are using an OO model not plain SQL.
There is a relationship between the classes and
Hibernate correctly handles that.
Arne
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
hibernate question (weird problem) Peter <mcheung63@hotmail.com> - 2015-07-25 17:10 +0800
Re: hibernate question (weird problem) Arne Vajhøj <arne@vajhoej.dk> - 2015-07-25 15:22 -0400
Re: hibernate question (weird problem) mcheung63@gmail.com - 2015-07-25 23:25 -0700
csiph-web