During delete org.springframework.dao.InvalidDataAccessApiUsageException: object references
Shinu Pil
Greenhorn
Joined: Sep 02, 2005
Posts: 9
posted
0
i have two mapping files Swon and project
these are the
and project
when i tried to delete the selected record using
getHibernateTemplate().delete(entity);
showing exception as
org.springframework.dao.InvalidDataAccessApiUsageException: object references an unsaved transient instance - save the transient instance before flushing: com.tel.it.model.Project;
i tried with cascade="all" not-null="false" but noluck
could any body help me as i am new to hibernate
As Jeanne said you are calling delete on a transient entity. This means you are trying to delete an entity that is not yet persisted (does not have an id). Also the use of Hibernate template is now discouraged. Take a look at the Spring documentation for the preferred approach.
SHINU SHINU.R wrote:i have two mapping files Swon and project
these are the
and project
when i tried to delete the selected record using
getHibernateTemplate().delete(entity);
showing exception as
org.springframework.dao.InvalidDataAccessApiUsageException: object references an unsaved transient instance - save the transient instance before flushing: .it.model.Project;
i tried with cascade="all" not-null="false" but noluck
could any body help me as i am new to hibernate