日期:2014-05-17 浏览次数:20807 次
<hibernate-mapping package="com.myproject.entity">
<class name="People" table="PEOPLE">
<meta attribute="sync-DAO">false</meta>
<cache usage="read-write"/>
<id name="id" type="java.lang.Long" column="PEOPLE_ID">
<generator class="sequence">
<param name="sequence">S_PEOPLE</param>
</generator>
</id>
<set name="pictures" inverse="true">
<key column="PEOPLE_ID"></key>
<one-to-many class="Picture"/>
</set>
</class>
</hibernate-mapping>
<hibernate-mapping package="com.myproject.entity">
<class name="Picture" table="PICTURE">
<meta attribute="sync-DAO">false</meta>
<cache usage="read-write"/>
<id name="id" type="java.lang.Long" column="PICTURE_ID">
<generator class="sequence">
<param name="sequence">S_PICTURE</param>
</generator>
</id>
<many-to-one name="people" column="PEOPLE_ID" class="People" not-null="false"></many-to-one>
</class>
</hibernate-mapping>
bean.setTitle(title);
bean.setAddTime(now());
save(bean);
2013-01-17 12:16 INFO c.j.d.a.f.PictureAction - savePicture()
2013-01-17 12:16 WARN c.o.x.i.ExceptionMappingInterceptor - null
java.lang.NullPointerException
at com.myproject.common.hibernate3.BaseManagerImpl.save(BaseManagerImpl.java:125) [BaseManagerImpl.class:na]
at com.myproject.manager.impl.PictureMngImpl.savePicture(PictureMngImpl.java:40) [PictureMngImpl.class:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [na:1.5.0_11]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) [na:1.5.0_11]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) [na:1.5.0_11]
at java.lang.reflect.Method.invoke(Unknown Source) [na:1.5.0_11]
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) [spring-aop-2.5.6.jar:2.5.6]
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) [spring-aop-2.5.6.jar:2.5.6]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) [spring-aop-2.5.6.jar:2.5.6]
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106) [spring-tx-2.5.6.jar:2.5.6]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) [spring-aop-2.5.6.jar:2.5.6]
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) [spring-aop-