Eclipse JPA problem on a named query that doesn't have a problem [message #804855] |
Wed, 22 February 2012 23:24  |
Eclipse User |
|
|
|
As of today, I am getting the following JPA error in Eclipse Indigo SR1:
"The identification variable 'name' is not defined in the FROM clause."
on the following class that I haven't touched in weeks and that compiles and runs without issue:
@XmlRootElement(name = "namespace")
@XmlType(name = "namespace",
propOrder = { "name", "description" })
@NamedQueries({ @NamedQuery(name = "NamespaceImpl.findUniqueByName", query = "SELECT n FROM NamespaceImpl n WHERE name = ?1") })
@Entity
@Table(name = "namespc")
public class NamespaceImpl {
private String name;
private String description;
public NamespaceImpl(final String name, final String description) {
this.name = name;
this.description = description;
}
@XmlElement
@Column(nullable = false, unique = true, length = 20)
@Override
public String getName() {
return name;
}
@Override
public void setName(final String name) {
this.name = name;
}
@XmlElement
@Column(length = 80)
@Override
public String getDescription() {
return description;
}
@Override
public void setDescription(final String description) {
this.description = description;
}
public NamespaceImpl() {
super();
}
}
Something must have changed recently, but I don't know what. The project is built with Maven and has the JPA facet. The JPA Platform for the project is set to "Generic 2.0" and the implementation has been set to "disable library configuration".
|
|
|
|
Re: Eclipse JPA problem on a named query that doesn't have a problem [message #808791 is a reply to message #805245] |
Tue, 28 February 2012 01:24  |
Eclipse User |
|
|
|
Indeed it did fix the problem. Thank you very much. As the named query hasn't changed, it must have been a Dali update to Indigo that trigger the validation error. I didn't know where clause variables needed qualification when selecting from just one table.
One other thing to note, when I fixed it and saved the Java file, for whatever reason, it did not trigger a revalidation. I had to explicitly trigger one by hand. Not sure what is up with that....
|
|
|
Powered by
FUDForum. Page generated in 0.03732 seconds