Hi,
I've got problem to exceute one update-HQL-query.
There tree tables:
Code:
CRAETE TABLE CATEGORY_GROUP (
CATEGORY_GROUP_ID,
NAME
)
CRAETE TABLE PARAMETER_CATEGORY (
PARAMETER_CATEGORY_ID,
NAME,
CATEGORY_GROUP_ID
REFERENCES( CATEGORY_GROUP .CATEGORY_GROUP_ID )
)
CRAETE TABLE PARAMETER (
PARAMETER_ID,
NAME,
VALUE,
PARAMETER_CATEGORY_ID,
REFERENCES( PARAMETER_CATEGORY.PARAMETER_CATEGORY_ID, )
)
I want to execute the following update query:
Code:
session.createQuery("UPDATE Parameter p SET p.desc = ? " +
"WHERE p.category.categoryGroup.name = ? ")
.setParameter(0, "updated_value")
.setParameter(1, "group_name").executeUpdate();
The hibernate generates sql query like this:
Code:
Hibernate: update PARAMETER, set VALUE=? where NAME=?
which is obviously wrong. Is it possibe to execute somehow update like this or hibernate does not have this functionality ??