You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Kai Feng Zhang (JIRA)" <ji...@apache.org> on 2010/09/15 13:48:33 UTC
[jira] Created: (OPENJPA-1796) JPQL parsing error on subclass if
field belongs to MappedSuperclass
JPQL parsing error on subclass if field belongs to MappedSuperclass
-------------------------------------------------------------------
Key: OPENJPA-1796
URL: https://issues.apache.org/jira/browse/OPENJPA-1796
Project: OpenJPA
Issue Type: Bug
Components: query
Affects Versions: 2.0.1
Reporter: Kai Feng Zhang
The class hierarchy is:
@MappedSuperclass
public class ListFieldDb{
@Basic
@Column(name="field_value", length=255)
protected String value;
}
@Entity
@Table(name = "email")
@PrimaryKeyJoinColumn(name = "oid")
@NamedQuery(name = EmailDb.FINDBY_EMAIL, query = "select e from EmailDb e where e.value = :email ")
public class EmailDb extends ListFieldDb {
Person person;
...
}
When I execute the query from entitymanager, there is an exception thrown:
<openjpa-2.0.1-r422266:989424 nonfatal user error> org.apache.openjpa.persistence.ArgumentException: An error occurred while parsing the query filter "select e from EmailDb e where e.value = :email". Error message: No field named "value" in "EmailDb". Did you mean "person"? Expected one of the available field names in "org.apache.shindig.social.opensocial.jpa.EmailDb": "[person]".
I am not sure if this is a known issue, or I missed something? Thanks.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
Re: [jira] Created: (OPENJPA-1796) JPQL parsing error on subclass
if field belongs to MappedSuperclass
Posted by Pinaki Poddar <pp...@apache.org>.
Hi,
1. Ensure that both ListFieldDb and EmailDb are specified in persistence.xml
<class> tags
2. Enhance the classes
-----
Pinaki
--
View this message in context: http://openjpa.208410.n2.nabble.com/jira-Created-OPENJPA-1796-JPQL-parsing-error-on-subclass-if-field-belongs-to-MappedSuperclass-tp5534079p5536351.html
Sent from the OpenJPA Developers mailing list archive at Nabble.com.