Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version: 3.0
Mapping documents:
<class name="Incident" table="OPR_INCIDENTS">
<meta attribute="extends" inherit="false">BaseBusinessObject</meta>
<id name="id" type="java.lang.Long">
<column name="SEQUENCE_ID" length="18" not-null="true" unique="true" sql-type="NUMBER" />
<generator class="hibernate.OpRiskKeyGenerator">
<param name="sequence">OPR_PRIMARYKEYGEN</param>
<param name="max_lo">100</param>
</generator>
</id>
<timestamp column="MODIFIED_TMSP" name="modifiedTmsp" />
<property name="incidentId" type="java.lang.String">
<column name="INCIDENT_ID" length="30" not-null="true" unique="true" sql-type="VARCHAR2" />
</property>
<property name="name" type="java.lang.String">
<column name="NAME" length="40" not-null="true" sql-type="VARCHAR2" />
</property>
<property name="descr" type="java.lang.String">
<column name="DESCR" length="3000" not-null="true" sql-type="VARCHAR2" />
</property>
<
component name="costPayingOu" class="model.type.Ou" >
<
property name="department" type="java.lang.String">
<column name="COST_PAYING_OU_DEPARTMENT" length="20" not-null="false" sql-type="VARCHAR2" />
</property>
<property name="uwi" type="java.lang.String">
<column name="COST_PAYING_OU_UWI" length="40" not-null="false" sql-type="VARCHAR2" />
</property>
</component>
</class>
Full stack trace of any exception that occurs:
org.hibernate.hql.ast.QuerySyntaxError: expecting EQ, found '.' near line 1, column 33 [update Incident set costPayingOu.department=:newValue where costPayingOu.uwi=:uwiName]
at org.hibernate.hql.ast.ErrorCounter.throwQueryException(ErrorCounter.java:63)
at org.hibernate.hql.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:215)
at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:127)
at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:83)
at org.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:427)
at org.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:884)
at org.hibernate.impl.SessionImpl.executeUpdate(SessionImpl.java:865)
at org.hibernate.impl.QueryImpl.executeUpdate(QueryImpl.java:89)
at batch.OEStructureImport.searchOpRiskUpdateOE(OEStructureImport.java:213)
at batch.OEStructureImport.execute(OEStructureImport.java:159)
at batch.OpriskBatchBase.run(OpriskBatchBase.java:47)
at batch.OEStructureImport.main(OEStructureImport.java:111)
Caused by: line 1:33: expecting EQ, found '.'
at antlr.Parser.match(Parser.java:211)
at org.hibernate.hql.antlr.HqlBaseParser.assignment(HqlBaseParser.java:400)
at org.hibernate.hql.antlr.HqlBaseParser.setClause(HqlBaseParser.java:338)
at org.hibernate.hql.antlr.HqlBaseParser.updateStatement(HqlBaseParser.java:183)
at org.hibernate.hql.antlr.HqlBaseParser.statement(HqlBaseParser.java:133)
at org.hibernate.hql.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:209)
... 10 more
The generated SQL (show_sql=true):
2005-09-06 08:41:20,655 INFO NOPID update Incident set costPayingOu.department=:newValue where costPayingOu.uwi=:uwiName ; OEStructureImport
08:41:20,935 ERROR PARSER - *** ERROR: line 1:33: expecting EQ, found '.'
Explanation:
I'm trying to perform a bulk update but am always receiving a parser exception. It is no DB exception, it doesn't even get that far. Is it not possible to update attributes within a composite?