[Hibernate-JIRA] Closed: (HHH-1201) Classic parser does not support DML style operations
by Steve Ebersole (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1201?page=c... ]
Steve Ebersole closed HHH-1201.
-------------------------------
Closing stale resolved issues
> Classic parser does not support DML style operations
> ----------------------------------------------------
>
> Key: HHH-1201
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1201
> Project: Hibernate Core
> Issue Type: Bug
> Environment: CVS HEAD
> Reporter: Mathias Bogaert
> Priority: Blocker
>
> Exception in thread "Thread-134" org.springframework.orm.hibernate3.HibernateQueryException: query must begin with SELECT or FROM: delete [delete from UnarchivedSample u where u.CABLE_MODEM_SAMPLE_ID = :CM_ID]; nested exception is org.hibernate.QueryException: query must begin with SELECT or FROM: delete [delete from UnarchivedSample u where u.CABLE_MODEM_SAMPLE_ID = :CM_ID]
> org.hibernate.QueryException: query must begin with SELECT or FROM: delete [delete from UnarchivedSample u where u.CABLE_MODEM_SAMPLE_ID = :CM_ID]
> at org.hibernate.hql.classic.ClauseParser.token(ClauseParser.java:83)
> at org.hibernate.hql.classic.PreprocessingParser.token(PreprocessingParser.java:108)
> at org.hibernate.hql.classic.ParserHelper.parse(ParserHelper.java:28)
> at org.hibernate.hql.classic.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:178)
> at org.hibernate.hql.classic.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:154)
> at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:74)
> at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:53)
> at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:71)
> at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:108)
> at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:88)
> at nl.nutsmaas.marvin.domain.persistence.hibernate.HibernateCableModemDao.archiveSamples(HibernateCableModemDao.java:195)
> Code:
> String hqlDelete = "delete from UnarchivedSample u where u.CABLE_MODEM_SAMPLE_ID = :CM_ID";
> int deletedEntities = getSessionFactory().getCurrentSession().createQuery( hqlDelete )
> .setLong( ":CM_ID", cableModem.getId()).executeUpdate();
> log.info("Deleted " + deletedEntities + " unarchived cable modem samples");
--
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
13 years, 10 months
[Hibernate-JIRA] Closed: (HHH-1014) id should still be null after unsuccessful saving of a new object - but isn't
by Steve Ebersole (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1014?page=c... ]
Steve Ebersole closed HHH-1014.
-------------------------------
Closing stale resolved issues
> id should still be null after unsuccessful saving of a new object - but isn't
> -----------------------------------------------------------------------------
>
> Key: HHH-1014
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1014
> Project: Hibernate Core
> Issue Type: Bug
> Components: core
> Affects Versions: 3.0.5
> Environment: postgresql, hibernate wired up via spring, also reproducible with 3.1 beta 3
> Reporter: Thomas Jachmann
> Assignee: Steve Ebersole
>
> I have quite a simple object: Utility. It's property name has to be unique:
> <class name="Utility">
> <id name="id">
> <generator class="sequence"/>
> </id>
> <version name="version"/>
> <property name="name" unique="true" not-null="true"/>
> <many-to-one name="postalAddress" column="postal_address_id" lazy="false" cascade="all" not-null="true"/>
> <many-to-one name="client" class="Client" column="client_id" lazy="false" cascade="all"/>
> <property name="phone"/>
> <property name="fax"/>
> </class>
> I think that the other properties/relationships don't matter.
> When I save a new Utility that's name already is in the database, I get a ConstraintViolationException. This is expected behaviour. But afterwards, the id of the utility is set. So are those of all related objects (postalAddress and client). As far as I understand it, they should be null indicating that the objects are still not persistet. When I change the name and try to save it again, I get a StaleObjectStateException. This seems to be a bug, since actually, the object isn't in the database because of the constraint violation.
> Regards,
> Thomas
--
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
13 years, 10 months
[Hibernate-JIRA] Closed: (HHH-1371) MappingException is thrown when the same column is referenced with different case
by Steve Ebersole (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1371?page=c... ]
Steve Ebersole closed HHH-1371.
-------------------------------
Closing stale resolved issues
> MappingException is thrown when the same column is referenced with different case
> ---------------------------------------------------------------------------------
>
> Key: HHH-1371
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1371
> Project: Hibernate Core
> Issue Type: Bug
> Components: core
> Affects Versions: 3.1.1
> Environment: Oracle Database 10g Enterprise Edition Release 10.1.0.4.0 - Production With the Partitioning, OLAP and Data Mining options
> JDBC Driver Version is Oracle JDBC driver 10.2.0.1.0
> Oracle Application Server Containers for J2EE 10g (10.1.2.0.2) (OC4J)
> Reporter: Jifeng Liu
> Assignee: Emmanuel Bernard
> Priority: Minor
> Fix For: 3.1.2
>
> Attachments: hibernate.cfg.xml, stacktrace.txt
>
>
> I got org.hibernate.MappingException: Same logical column name referenced several times: Marking_Periods.School_Id School_ID School_Id. Please see attached file for full stack trace. My mapping file works for Hibernate 3.1. But it fails after I installed Hibernate 3.1.1 jar file.
> The mapping file that causes MappingException is:
> <hibernate-mapping>
> <class name="com.senior.bll.academic.school.MarkingPeriod"
> table="Marking_Periods" rowid="rowid">
> <composite-id>
> <key-property name="schoolId" column="School_ID"/>
> <key-property name="academicYear" column="Academic_Yr"/>
> <key-property name="sortNo" column="Period_Sort_No"/>
> </composite-id>
> <property name="name" column="Name"/>
> <property name="abbrev" column="Abbrev"/>
>
> <!--
> this many-to-one uses School_Id, Academic_Yr field that is also used in other places. That is the reason
> that it has properties: insert="false" update="false".
> -->
> <property name="termSortNo" column="Term_Sort_No"/>
> <many-to-one name="term" cascade="save-update"
> fetch="join" insert="false" update="false"
> >
> <column name="School_Id" />
> <column name="Academic_Yr" />
> <column name="Term_Sort_No" />
> </many-to-one>
>
> <filter name="schoolId" condition="School_Id=:schoolId"/>
> </class>
> </hibernate-mapping>
--
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
13 years, 10 months