-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Newbie - Join Problem
PostPosted: Mon Jun 22, 2009 8:49 am 
Newbie

Joined: Mon Jun 22, 2009 8:41 am
Posts: 3
private static final String EJBQL = "from Student as student left join student.Person";

The above join syntax is generating errors, I don't know how to correct it. Below is my classes. Thanks for any help.

public class Student implements java.io.Serializable {
private int studentkey;
private int status;
public Student() {}

@OneToOne (optional=false, cascade=CascadeType.ALL)
@JoinColumn(name="MASTERKEY", unique=true, nullable=false, insertable=true, updatable=true)
private Person person;
/* setters-getters */
}
public class Person implements java.io.Serializable {
private int personkey;
private String lname;
private String fname;

@OneToOne (optional=false, mappedBy="person")
private Student student;
/* setters-getters */
}


Top
 Profile  
 
 Post subject: Re: Newbie - Join Problem
PostPosted: Mon Jun 22, 2009 9:22 am 
Senior
Senior

Joined: Tue Jul 25, 2006 9:05 am
Posts: 163
Location: Stuttgart/Karlsruhe, Germany
try changing
Code:
private static final String EJBQL = "from Student as student left join student.Person";

to
Code:
private static final String EJBQL = "from Student as student left join student.person";


Cheers,

Andy

_________________
Rules are only there to be broken


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.