From: Steve E. (JIRA) <no...@at...> - 2006-05-30 14:19:26
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1791?page=all ] Steve Ebersole resolved HHH-1791: --------------------------------- Fix Version: 3.2.0 Resolution: Fixed Assign To: Steve Ebersole Yes, the binder code was messed up for this combination of options (generated="insert" and update="false"); the generated="insert" caused update="false" to be overriden as update="true" > property update="false" ignored since 3.2.0.cr2 > ----------------------------------------------- > > Key: HHH-1791 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1791 > Project: Hibernate3 > Type: Bug > Components: core > Versions: 3.2.0.cr2 > Environment: Hibernate 3.2.0.cr2, MS SQL Server 2000, jTDS > Reporter: Thomas Boerkel > Assignee: Steve Ebersole > Fix For: 3.2.0 > > > Mapping: > <class name="p2plus.AuftragPos" table="AUFTRAGPOS"> > <cache usage="read-write"/> > > <composite-id> > <key-property name="auftrag" access="field"/> > <key-property name="position" access="field"/> > </composite-id> > <version name="timestamp" type="byte[]" generated="always" access="field"/> > <property name="id" access="field" generated="insert" update="false" insert="false"/> > <property name="artikel" access="field"/> > <property name="preis" access="field"/> > <property name="datum" access="field"/> > </class> > I fetch an object, change a property and save. > Hibernate 3.2.0.cr1 executes: > update AUFTRAGPOS set artikel=?, preis=?, datum=? where auftrag=? and position=? and timestamp=? > Hibernate 3.2.0.cr2 executes: > update AUFTRAGPOS set id=?, artikel=?, preis=?, datum=? where auftrag=? and position=? and timestamp=? > Code: > Session session = HibernateUtil.getSessionFactory().getCurrentSession(); > session.beginTransaction(); > > AuftragPos auftragPos = new AuftragPos(); > auftragPos.setAuftrag("4711"); > auftragPos.setPosition((short)3); > auftragPos.setArtikel("V-10000"); > auftragPos.setPreis(45); > auftragPos.setDatum(new Date()); > session.save(auftragPos); > > auftragPos = (AuftragPos)session.createQuery("from AuftragPos where position=3").uniqueResult(); > auftragPos.setPreis(78); > session.save(auftragPos); > > session.getTransaction().commit(); -- 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.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |