[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-2792) Session.delete is validate all fields are null

Chris Rose (JIRA) noreply at atlassian.com
Thu Aug 23 13:30:57 EDT 2007


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-2792?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_27930 ] 

Chris Rose commented on HHH-2792:
---------------------------------

I'd like to clarify this; this is an issue I'm having, too; I call delete on an entity with its id field filled in, but the nullability of _all_ of its fields is validated as an _update_ prior to deletion.

The code in question is in DefaultDeleteEventListener.deleteEntity(
			final EventSource session,
			final Object entity,
			final EntityEntry entityEntry,
			final boolean isCascadeDeleteEnabled,
			final EntityPersister persister,
			final Set transientEntities)

on line 250:
new Nullability( session ).checkNullability( entityEntry.getDeletedState(), persister, true );

This checks the entity as if it were an update, which causes a PropertyValueException in the case that the key itself is provided, but no other properties are filled in, which should not be necessary for a delete operation.

> Session.delete is validate all fields are null
> ----------------------------------------------
>
>                 Key: HHH-2792
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2792
>             Project: Hibernate3
>          Issue Type: Bug
>          Components: core
>            Reporter: Daniel Passos
>
> session.delete operation would not have to validate if the fields are null
> The problem in DefaultDeleteEventListener.deleteEntity -> Nullability.checkNullability

-- 
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

        



More information about the hibernate-issues mailing list