[
http://opensource.atlassian.com/projects/hibernate/browse/HHH-2922?page=c...
]
Eugene commented on HHH-2922:
-----------------------------
Query query = em.createQuery("update Property p set p.key.address = ?1 where
p.key.address = ?2");
@Table(name="Properties")
@DiscriminatorColumn(length = 50)
public abstract class Property implements Serializable {
private PropertyPK key;
private String displayName = "";
private String displayDescription = "";
private Date actualTimestamp = new Date();
private boolean readOnly = false;
private boolean system = false;
private int sortPriority = 100;
private String describerClassName = null;
private int level = 0;
private String path = "";
......
@Embeddable
public class PropertyPK implements Serializable {
private Address address;
private String componentName;
private String name;
...........
@Embeddable
public class Address implements Serializable{
private int country = 0;
private int region = 0;
private int store = 0;
private int workplace = 0;
Caused by: org.hibernate.hql.ast.QuerySyntaxException: unexpected AST node: AND near line
1, column 77 [update ru.crystalservice.setv6.core.properties.Property p set p.key.address
= ?1, p.key.componentName = p.key.componentName where p.key.address = ?2]
at org.hibernate.hql.ast.QuerySyntaxException.convert(QuerySyntaxException.java:31)
at org.hibernate.hql.ast.QuerySyntaxException.convert(QuerySyntaxException.java:24)
at org.hibernate.hql.ast.ErrorCounter.throwQueryException(ErrorCounter.java:59)
at org.hibernate.hql.ast.exec.BasicExecutor.<init>(BasicExecutor.java:42)
at
org.hibernate.hql.ast.QueryTranslatorImpl.buildAppropriateStatementExecutor(QueryTranslatorImpl.java:529)
at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:176)
at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:111)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:77)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:56)
at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:72)
at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:133)
at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:112)
at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1623)
at
org.hibernate.ejb.AbstractEntityManagerImpl.createQuery(AbstractEntityManagerImpl.java:92)
... 68 more
DML - update does not support component property in the set-clause
------------------------------------------------------------------
Key: HHH-2922
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-2922
Project: Hibernate Core
Issue Type: Bug
Components: query-hql
Affects Versions: 3.2.4.sp1
Reporter: Roman Pichlík
Using of component property in in the set-clause of HQL update query leads to:
org.springframework.orm.hibernate3.HibernateQueryException: unexpected AST node: AND near
line 1, column 43 [update x a set a.component = : where a._revision = :revision and
a._uuid = :uuid]; nested exception is org.hibernate.hql.ast.QuerySyntaxException:
unexpected AST node: AND near line 1, column 43 [update artifactBase a set a._artifactData
= :artifactData where a._revision = :revision and a._uuid = :uuid]
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira