hibernate的映射出问题,我是想建立双向(List)的1-N关系

问题描述

hibernate的映射出问题,我是想建立双向的1-N关系,用在Set就可以,但是用List就不行,为什么?而且我用同样的方法对另外的一个双向的1-N关系做List映射是可以的,就是到了这个就不行首先发问题:ERROR11:46:44[ContextLoader:206]-Contextinitializationfailed22766org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:206)org.springframework.beans.factory.BeanCreationException:Errorcreatingbeanwithname'org.springframework.context.annotation.internalRequiredAnnotationProcessor':BeanPostProcessorbeforeinstantiationofbeanfailed;nestedexceptionisorg.springframework.beans.factory.BeanCreationException:Errorcreatingbeanwithname'genericTx':Initializationofbeanfailed;nestedexceptionisorg.springframework.beans.factory.BeanCreationException:Errorcreatingbeanwithname'cxf'definedinclasspathresource[META-INF/cxf/cxf.xml]:Initializationofbeanfailed;nestedexceptionisorg.springframework.beans.factory.BeanCreationException:Errorcreatingbeanwithname'org.springframework.transaction.config.internalTransactionAdvisor':Cannotcreateinnerbean'(innerbean)'oftype[org.springframework.transaction.interceptor.TransactionInterceptor]whilesettingbeanproperty'transactionInterceptor';nestedexceptionisorg.springframework.beans.factory.BeanCreationException:Errorcreatingbeanwithname'(innerbean)#9':Cannotresolvereferencetobean'transactionManager'whilesettingbeanproperty'transactionManager';nestedexceptionisorg.springframework.beans.factory.BeanCreationException:Errorcreatingbeanwithname'transactionManager'definedinURL[file:/F:/workspace/gxyc/WebContent/WEB-INF/classes/applicationContext.xml]:Cannotresolvereferencetobean'sessionFactory'whilesettingbeanproperty'sessionFactory';nestedexceptionisorg.springframework.beans.factory.BeanCreationException:Errorcreatingbeanwithname'sessionFactory'definedinURL[file:/F:/workspace/gxyc/WebContent/WEB-INF/classes/applicationContext.xml]:Invocationofinitmethodfailed;nestedexceptionisorg.hibernate.MappingException:Repeatedcolumninmappingforcollection:com.skylink.csms.ycob.model.CallInspectInfo.inspectDetailInfoscolumn:SIDatorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:481)atjava.security.AccessController.doPrivileged(NativeMethod)atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:455)atorg.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251)atorg.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:169)atorg.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248)atorg.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:170)atorg.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:883)atorg.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:593)atorg.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:351)atorg.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:251)atorg.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:190)atorg.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)atorg.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:551)atorg.mortbay.jetty.servlet.Context.startContext(Context.java:140)atorg.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1341)atorg.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:520)atorg.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:474)atorg.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:42)atorg.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:151)atorg.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:42)atorg.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)atorg.mortbay.jetty.Server.doStart(Server.java:223)atorg.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:42)atorg.mortbay.xml.XmlConfiguration.main(XmlConfiguration.java:982)

解决方案

解决方案二:
Causedby:org.springframework.beans.factory.BeanCreationException:Errorcreatingbeanwithname'org.springframework.transaction.config.internalTransactionAdvisor':Cannotcreateinnerbean'(innerbean)'oftype[org.springframework.transaction.interceptor.TransactionInterceptor]whilesettingbeanproperty'transactionInterceptor';nestedexceptionisorg.springframework.beans.factory.BeanCreationException:Errorcreatingbeanwithname'(innerbean)#9':Cannotresolvereferencetobean'transactionManager'whilesettingbeanproperty'transactionManager';nestedexceptionisorg.springframework.beans.factory.BeanCreationException:Errorcreatingbeanwithname'transactionManager'definedinURL[file:/F:/workspace/gxyc/WebContent/WEB-INF/classes/applicationContext.xml]:Cannotresolvereferencetobean'sessionFactory'whilesettingbeanproperty'sessionFactory';nestedexceptionisorg.springframework.beans.factory.BeanCreationException:Errorcreatingbeanwithname'sessionFactory'definedinURL[file:/F:/workspace/gxyc/WebContent/WEB-INF/classes/applicationContext.xml]:Invocationofinitmethodfailed;nestedexceptionisorg.hibernate.MappingException:Repeatedcolumninmappingforcollection:com.skylink.csms.ycob.model.CallInspectInfo.inspectDetailInfoscolumn:SIDatorg.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:229)atorg.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:122)atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1274)atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1042)atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:485)atjava.security.AccessController.doPrivileged(NativeMethod)atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:455)atorg.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251)atorg.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:169)atorg.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248)atorg.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:170)atorg.springframework.aop.framework.autoproxy.BeanFactoryAdvisorRetrievalHelper.findAdvisorBeans(BeanFactoryAdvisorRetrievalHelper.java:87)atorg.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.findCandidateAdvisors(AbstractAdvisorAutoProxyCreator.java:98)atorg.springframework.aop.aspectj.annotation.AnnotationAwareAspectJAutoProxyCreator.findCandidateAdvisors(AnnotationAwareAspectJAutoProxyCreator.java:83)atorg.springframework.aop.aspectj.autoproxy.AspectJAwareAdvisorAutoProxyCreator.shouldSkip(AspectJAwareAdvisorAutoProxyCreator.java:105)atorg.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.postProcessAfterInitialization(AbstractAutoProxyCreator.java:290)atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.java:334)atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1368)atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:540)...52more
解决方案三:
Causedby:org.springframework.beans.factory.BeanCreationException:Errorcreatingbeanwithname'(innerbean)#9':Cannotresolvereferencetobean'transactionManager'whilesettingbeanproperty'transactionManager';nestedexceptionisorg.springframework.beans.factory.BeanCreationException:Errorcreatingbeanwithname'transactionManager'definedinURL[file:/F:/workspace/gxyc/WebContent/WEB-INF/classes/applicationContext.xml]:Cannotresolvereferencetobean'sessionFactory'whilesettingbeanproperty'sessionFactory';nestedexceptionisorg.springframework.beans.factory.BeanCreationException:Errorcreatingbeanwithname'sessionFactory'definedinURL[file:/F:/workspace/gxyc/WebContent/WEB-INF/classes/applicationContext.xml]:Invocationofinitmethodfailed;nestedexceptionisorg.hibernate.MappingException:Repeatedcolumninmappingforcollection:com.skylink.csms.ycob.model.CallInspectInfo.inspectDetailInfoscolumn:SIDatorg.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:274)atorg.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:104)atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1274)atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1042)atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:485)atjava.security.AccessController.doPrivileged(NativeMethod)atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:455)atorg.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:219)...71moreCausedby:org.springframework.beans.factory.BeanCreationException:Errorcreatingbeanwithname'transactionManager'definedinURL[file:/F:/workspace/gxyc/WebContent/WEB-INF/classes/applicationContext.xml]:Cannotresolvereferencetobean'sessionFactory'whilesettingbeanproperty'sessionFactory';nestedexceptionisorg.springframework.beans.factory.BeanCreationException:Errorcreatingbeanwithname'sessionFactory'definedinURL[file:/F:/workspace/gxyc/WebContent/WEB-INF/classes/applicationContext.xml]:Invocationofinitmethodfailed;nestedexceptionisorg.hibernate.MappingException:Repeatedcolumninmappingforcollection:com.skylink.csms.ycob.model.CallInspectInfo.inspectDetailInfoscolumn:SIDatorg.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:274)atorg.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:104)atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1274)atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1042)atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:485)atjava.security.AccessController.doPrivileged(NativeMethod)atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:455)atorg.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251)atorg.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:169)atorg.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248)atorg.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:170)atorg.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:268)...79more
解决方案四:
...100more31406[main]ERRORorg.mortbay.log-Failedstartupofcontextorg.mortbay.jetty.webapp.WebAppContext@1c2e5bb{/gxyc,F:workspacegxycWebContent}org.springframework.beans.factory.BeanCreationException:Errorcreatingbeanwithname'org.springframework.context.annotation.internalRequiredAnnotationProcessor':BeanPostProcessorbeforeinstantiationofbeanfailed;nestedexceptionisorg.springframework.beans.factory.BeanCreationException:Errorcreatingbeanwithname'genericTx':Initializationofbeanfailed;nestedexceptionisorg.springframework.beans.factory.BeanCreationException:Errorcreatingbeanwithname'cxf'definedinclasspathresource[META-INF/cxf/cxf.xml]:Initializationofbeanfailed;nestedexceptionisorg.springframework.beans.factory.BeanCreationException:Errorcreatingbeanwithname'org.springframework.transaction.config.internalTransactionAdvisor':Cannotcreateinnerbean'(innerbean)'oftype[org.springframework.transaction.interceptor.TransactionInterceptor]whilesettingbeanproperty'transactionInterceptor';nestedexceptionisorg.springframework.beans.factory.BeanCreationException:Errorcreatingbeanwithname'(innerbean)#9':Cannotresolvereferencetobean'transactionManager'whilesettingbeanproperty'transactionManager';nestedexceptionisorg.springframework.beans.factory.BeanCreationException:Errorcreatingbeanwithname'transactionManager'definedinURL[file:/F:/workspace/gxyc/WebContent/WEB-INF/classes/applicationContext.xml]:Cannotresolvereferencetobean'sessionFactory'whilesettingbeanproperty'sessionFactory';nestedexceptionisorg.springframework.beans.factory.BeanCreationException:Errorcreatingbeanwithname'sessionFactory'definedinURL[file:/F:/workspace/gxyc/WebContent/WEB-INF/classes/applicationContext.xml]:Invocationofinitmethodfailed;nestedexceptionisorg.hibernate.MappingException:Repeatedcolumninmappingforcollection:com.skylink.csms.ycob.model.CallInspectInfo.inspectDetailInfoscolumn:SIDatorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:481)atjava.security.AccessController.doPrivileged(NativeMethod)atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:455)atorg.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251)
解决方案五:
publicclassInspectDetailInfoimplementsjava.io.Serializable{//Fields/****/privatestaticfinallongserialVersionUID=-2906746596383878133L;privateLongid;//过程ID(主键)privateCallInspectInfocallInspectInfo;//督察单号privateStringinspectIdea;//督察意见privateStringdealMan;//处理人privateDatedealTime;//处理时间publicclassCallInspectInfoimplementsjava.io.Serializable{//Fields/****/privatestaticfinallongserialVersionUID=-1281858414838153032L;privateStringsid;//督察编号privateStringsrcType;//源单类型privateStringsrcId;//源单号privateStringengineNo;//发动机号privateStringcreateMan;//创建人privateDatecreateTime;//创建时间privateStringremindMan;//提醒人privateDateremindTime;//提醒时间privateStringstatus;//状态:0-未完成,2-已完成//privateSetinspectDetailInfos=newHashSet(0);privateList<InspectDetailInfo>inspectDetailInfos=newArrayList<InspectDetailInfo>();
解决方案六:
<?xmlversion="1.0"encoding="utf-8"?><!DOCTYPEhibernate-mappingPUBLIC"-//Hibernate/HibernateMappingDTD3.0//EN""http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"><!--MappingfileautogeneratedbyMyEclipsePersistenceTools--><hibernate-mapping><classname="com.skylink.csms.ycob.model.InspectDetailInfo"table="SLYC_INSPECT_DETAIL_T"schema="YCCC"><idname="id"type="java.lang.Long"><columnname="ID"precision="22"scale="0"/><generatorclass="com.skylink.common.hibernate.generator.NumberIncrease"/></id><many-to-onename="callInspectInfo"class="com.skylink.csms.ycob.model.CallInspectInfo"fetch="select"><columnname="SID"precision="20"scale="0"/></many-to-one><propertyname="inspectIdea"type="java.lang.String"><columnname="INSPECT_IDEA"length="256"/></property><propertyname="dealMan"type="java.lang.String"><columnname="DEAL_MAN"length="32"/></property><propertyname="dealTime"type="java.util.Date"><columnname="DEAL_TIME"length="7"/></property></class></hibernate-mapping>
解决方案七:
<?xmlversion="1.0"encoding="utf-8"?><!DOCTYPEhibernate-mappingPUBLIC"-//Hibernate/HibernateMappingDTD3.0//EN""http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"><!--MappingfileautogeneratedbyMyEclipsePersistenceTools--><hibernate-mapping><classname="com.skylink.csms.ycob.model.CallInspectInfo"table="SLYC_CALL_INSPECT_T"><idname="sid"type="java.lang.String"><columnname="SID"length="20"/><generatorclass="com.skylink.common.hibernate.generator.ShortDateIncresment"/></id><propertyname="srcType"type="java.lang.String"><columnname="SRC_TYPE"length="10"/></property><propertyname="srcId"type="java.lang.String"><columnname="SRC_ID"length="20"/></property><propertyname="engineNo"type="java.lang.String"><columnname="ENGINE_NO"length="30"/></property><propertyname="createMan"type="java.lang.String"><columnname="CREATE_MAN"length="20"/></property><propertyname="createTime"type="java.util.Date"><columnname="CREATE_TIME"length="7"/></property><propertyname="remindMan"type="java.lang.String"><columnname="REMIND_MAN"length="20"/></property><propertyname="remindTime"type="java.util.Date"><columnname="REMIND_TIME"length="7"/></property><propertyname="status"type="java.lang.String"><columnname="STATUS"length="2"/></property><listname="inspectDetailInfos"cascade="all"inverse="true"><keycolumn="SID"/><!--多的一方的字段--><indexcolumn="SID"/><!--自己的ID--><one-to-manyclass="com.skylink.csms.ycob.model.InspectDetailInfo"/></list></class></hibernate-mapping>
解决方案八:
关键在这里:Repeatedcolumninmappingforcollection:com.skylink.csms.ycob.model.CallInspectInfo.inspectDetailInfoscolumn:SIDsid被映射到集合,又映射成属性,重复映射了?
解决方案九:
学习了
解决方案十:
引用7楼gdfloyd的回复:

关键在这里:Repeatedcolumninmappingforcollection:com.skylink.csms.ycob.model.CallInspectInfo.inspectDetailInfoscolumn:SIDsid被映射到集合,又映射成属性,重复映射了?

也不是啊,InspectDetailInfo里本来就有SID这个字段,估计是在<listname="inspectDetailInfos"cascade="all"inverse="true"><keycolumn="SID"/><!--多的一方的字段--><indexcolumn="SID"/><!--自己的ID--><one-to-manyclass="com.skylink.csms.ycob.model.InspectDetailInfo"/></list>里<key和<index都是用SID所以是不是系统自己搞混了,就像人脑不知道去找哪个一样。
解决方案十一:
该回复于2011-03-10 15:14:49被版主删除

时间: 2024-11-19 14:12:40

hibernate的映射出问题,我是想建立双向(List)的1-N关系的相关文章

Java的Hibernate框架中一对多的单向和双向关联映射_java

一.一对多单向关联映射 一对多关系的对象模型在日常生活中也经常看到,就拿学生和班级来说,一个班级里有多个学生,所以班级和学生的关系是一对多的关系,映射到对象模型中,如下图: 对象模型说明了这种一对多的关系是由一的一端来维护的,那么映射成关系模型就是一个班级字段下面会有多个学生,这样就形成了一对多的关系,通过班级能够查询获得学生信息,对应的关系模型如下图: 1.基本配置 有了对象模型接下来就让它们映射为对应的关系代码,在进行关系映射时需要在一的一端添加<one-to-many>标签,另外还需要在

设计表 hibernate-表的设置,和hibernate的映射

问题描述 表的设置,和hibernate的映射 我想设置这样的一个表,他有一个外键,这个外键可以对应多个表, 比如(A表,B表,C表)有一个判断类型字段type,我想让这个外键可以对应多个表的主键, 比如: type等于1时此时的外键对应的是A表的主键,类型type等于2时此时的外键对应的是B表的主键.请问怎么设置, 如果使用hibernate来映射的话,怎么写映射文件?

Hibernate 的映射问题 求助啊

问题描述 Hibernate 的映射问题 求助啊 为什么 第二个sysotem.out.println() 不执行呢 解决方案 Service.java public class Service { ?/**???? * 与BindInfo many-to-many 中间表 ServiceBindInfo???? */??? private Set<Product> products =......答案就在这里:hibernate映射问题 解决方案二: 这么一小段程序看不出什么. 可能在set

ssh项目中hibernate查询时出问题

问题描述 ssh项目中hibernate查询时出问题 大神快来帮忙看看 解决方案 http://blog.csdn.net/merry3602/article/details/7063226 解决方案二: 报错SysAdmin未映射,重点是配置文件对不对. 首先检查你画线的地方路径写对了没有,其次要去检查SysAdmin.hbm.xml里面class标签的name属性值有没有打对,点路径有没有写对,最好把schema属性删除. 最后,看一下其他的.hbm.xml里有没有引用到SysAdmin的,

人才储备不足映射出“大数据”技术缺陷

本文讲的是人才储备不足映射出"大数据"技术缺陷,根据咨询师和IT经理的观点,"大数据"分析的最大挑战可以简单地归结为两个方面:1.技术尚未成且用户体验不佳;2.缺乏相关领域的技术人才储备. 许多大数据技术(如Hadoop MapReduce)都来自开源社区,由致力于研究高效处理大容量信息的互联网志愿者进行开发,如Google和Yahoo,其中包括结构化和非结构化数据.因此,大多数技术在成熟度和可访问性方面都不及传统数据库和数据管理套件,而且可用于帮助数据仓库和分析人

hibernate-Oracle数据库中新增一个字段,Hibernate中映射怎样加?

问题描述 Oracle数据库中新增一个字段,Hibernate中映射怎样加? 问题:我在oracle数据库中新增一个字段,那么在Hibernate映射中,需要手动加进去吗?在中. 谢谢!! 解决方案 类似这样,第一个name对应实体中,第二个name对应数据库 解决方案二:

角色和权限Hibernate实体映射配置

角色实体 package cn.itcast.oa.domain; import java.util.HashSet; import java.util.Set; /**  * 岗位  *   * @author tyg  *   */ public class Role {     private Long id;     private String name;     private String description;     private Set<User> users = ne

hibernate的映射关系的问题

问题描述 hibernate的映射关系的问题 解决方案 第二个Sysotem.out.println() 不执行是为什么 解决方案二: 程序信息太少,但是第二句输出没执行,可能的原因就是collect.setGoods(g);这个操作出现异常了: 可能是collect为null,则会出现空指针异常,可能是在你的setGoods方法中做了一些导致异常的处理. 解决方案三: ????如果为主键关联, 在hibernate中当关系为1-1时候 并且此表的主键为外键的时候 则设置的属性为?/**????

我是想给Javascript函数的参数传一个对象。

问题描述 varmyClient;//设置洽谈的对象functionSetTalkClient(cl){alert(cl.UserID);}//将用户插入到已接待用户的列表functionDealInsertReceptionClient(userID,userName){myClient.UserID=userID;myClient.UserName=userName;aaa.innerHTML="<ahref='javascript:void(null)'onclick='SetTal