2011-11-1 22:25:01 org.apache.catalina.core.StandardWrapperValve invoke
严重: Servlet.service() for servlet default threw exception
org.hibernate.TransientObjectException: object references an unsaved transient instance - save the transient instance before flushing: org.shj.houseproject.pojo.Area
at org.hibernate.engine.ForeignKeys.getEntityIdentifierIfNotUnsaved(ForeignKeys.java:219)
at org.hibernate.type.EntityType.getIdentifier(EntityType.java:397)
at org.hibernate.type.ManyToOneType.nullSafeSet(ManyToOneType.java:78)
at org.hibernate.persister.entity.AbstractEntityPersister.dehydrate(AbstractEntityPersister.java:1997)
at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2371)
下面是我的pojo
area.hbm.xml
catalog="houseProject" lazy="false">
house.bhm.xml
catalog="houseproject" lazy="false">
fetch="select" lazy="false" cascade="save-update,persist">
fetch="select" lazy="false" cascade="save-update,persist">
street.hbm.xml
catalog="houseproject" lazy="false">
fetch="select" lazy="false">
user.hbm.xml
catalog="houseproject">
length="30">
我其实就是想把数据加到house表里面就出现异常
希望大家帮帮我我新手一个