You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by Pieter Pareit <pi...@easypay.be> on 2009/08/27 08:59:23 UTC

Error in LEFT JOIN FETCH xxxx as

Hi,

I'm testing openJPA-2.0.0.SNAPSHOT.
I have an error in my JPQL.

List<CompanyEffDate> rows = em.createQuery("SELECT c FROM CompanyEffDate as
c LEFT OUTER JOIN FETCH c.companyAddresses as ca").getResultList();

<openjpa-2.0.0-EA2-SNAPSHOT-r422266:781480 nonfatal user error>
org.apache.openjpa.persistence.ArgumentException: "Encountered "as" at
character 76, but expected: [",", ".", "GROUP", "HAVING", "INNER", "JOIN",
"LEFT", "ORDER", "WHERE", <EOF>]." while parsing JPQL "SELECT c FROM
CompanyEffDate as c LEFT OUTER JOIN FETCH c.companyAddresses as ca". See
nested stack trace for original parse error.

When I remove the "as ca" the query works fine.
For me this this seems like an error in JPQL?

Attention!
There Foreignkey companyAddresses is mapped by a non-standard join.

@OneToMany
@ElementJoinColumn(name="companyId", referencedColumnName="id")
private List<CompanyAddressEffDate> companyAddresses;

public List<CompanyAddressEffDate> getCompanyAddresses() {
	return companyAddresses;
}

public void setCompanyAddresses(List<CompanyAddressEffDate>
companyAddresses) {
	this.companyAddresses = companyAddresses;
}

Regards,
Pieter Pareit
http://www.easypay-group.com


-- 
View this message in context: http://n2.nabble.com/Error-in-LEFT-JOIN-FETCH-xxxx-as-tp3521812p3521812.html
Sent from the OpenJPA Developers mailing list archive at Nabble.com.