I have HQL statement:
insert into Item (ost, value, comments, startTime, endTime, proposedBy)
select si.ost, si.value, si.comments, si.endTime, si.endTime, u
from Item si, User u
where si.ost = ? and u.id = ?
How could it be modified to use parameters' values for ost
and startTime
columns while taking other columns from select
?
Can’t be done in HQL; it doesn’t allow parameter references in the select clause.
I don't know about that last answer. I am using NH 3.2 and I was able to get this to work
In this example I needed to create a new EventFacility object. With pretty much all the fields you see here. The Event entity has another entity, Owner hanging off of it.