通过页面添加数据的时候could not resolve property: name of:“包名”(急,我已经研究了两天了)
在页面上数据显示已经成功。
可是在添加数据时却报下面的错误。
hbm.xml文件我已经看过了,字段名没有错误呀。
org.hibernate.QueryException: could not resolve property: name of: org.zframework.web.entity.system.OfficeTable at org.hibernate.persister.entity.AbstractPropertyMapping.propertyException(AbstractPropertyMapping.java:83)
at org.hibernate.persister.entity.AbstractPropertyMapping.toType(AbstractPropertyMapping.java:77)
at org.hibernate.persister.entity.AbstractEntityPersister.getSubclassPropertyTableNumber(AbstractEntityPersister.java:1945)
at org.hibernate.persister.entity.BasicEntityPropertyMapping.toColumns(BasicEntityPropertyMapping.java:61)
at org.hibernate.persister.entity.AbstractEntityPersister.toColumns(AbstractEntityPersister.java:1920)
at org.hibernate.loader.criteria.CriteriaQueryTranslator.getColumns(CriteriaQueryTranslator.java:523)
at org.hibernate.loader.criteria.CriteriaQueryTranslator.findColumns(CriteriaQueryTranslator.java:538)
at org.hibernate.criterion.SimpleExpression.toSqlString(SimpleExpression.java:66)
at org.hibernate.loader.criteria.CriteriaQueryTranslator.getWhereCondition(CriteriaQueryTranslator.java:419)
at org.hibernate.loader.criteria.CriteriaJoinWalker.<init>(CriteriaJoinWalker.java:123)
at org.hibernate.loader.criteria.CriteriaJoinWalker.<init>(CriteriaJoinWalker.java:92)
at org.hibernate.loader.criteria.CriteriaLoader.<init>(CriteriaLoader.java:95)
at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1602)
at org.hibernate.internal.CriteriaImpl.list(CriteriaImpl.java:374)
at org.hibernate.internal.CriteriaImpl.uniqueResult(CriteriaImpl.java:396)
at org.zframework.orm.dao.BaseHibernateDaoImpl.getBy(BaseHibernateDaoImpl.java:255)
at org.zframework.web.service.BaseService.getByProperties(BaseService.java:113)
at org.zframework.web.service.admin.system.OfficeDepotServer.executeAdd(OfficeDepotServer.java:78)
at org.zframework.web.service.admin.system.OfficeDepotServer$$FastClassByCGLIB$$516e69ee.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:698)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.springframework.aop.framework.adapter.AfterReturningAdviceInterceptor.invoke(AfterReturningAdviceInterceptor.java:50)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:50)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.adapter.ThrowsAdviceInterceptor.invoke(ThrowsAdviceInterceptor.java:124)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.adapter.AfterReturningAdviceInterceptor.invoke(AfterReturningAdviceInterceptor.java:50)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:50)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:631)
at org.zframework.web.service.admin.system.OfficeDepotServer$$EnhancerByCGLIB$$f57fb072.executeAdd(<generated>)
at org.zframework.web.controller.admin.system.OfficeTableController.doAdd(OfficeTableController.java:91)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:176)
at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:439)
at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:427)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:925)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:915)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:822)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:796)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.zframework.core.web.filter.FrameworkFilter.doFilter(FrameworkFilter.java:27)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)
这是类的代码
@Entity@Table(name="sys_officedepot")
public class OfficeTable {
private Integer id;
private String goodsname;
private Integer warehouseamount;
private String units;
private String warehousename;
private String supplier;
private String types;
private String pictures;
private String thewarehousepeople;
private String thestoragetime;
private String lastborrower;
private String lastborrowtime;
private String remarks;
@Id
@GeneratedValue(strategy = GenerationType.AUTO, generator = "seq_sys_officedepot")
@SequenceGenerator(name = "seq_sys_officedepot", sequenceName = "seq_sys_officedepot")
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
@Column(name="GOODSNAME",nullable=false,length=50)
public String getGoodsname() {
return goodsname;
}
public void setGoodsname(String goodsname) {
this.goodsname = goodsname;
}
@Column(name="WAREHOUSEAMOUNT",nullable=false,length=50)
public Integer getWarehouseamount() {
return warehouseamount;
}
public void setWarehouseamount(Integer warehouseamount) {
this.warehouseamount = warehouseamount;
}
@Column(name="UNITS",nullable=false,length=50)
public String getUnits() {
return units;
}
public void setUnits(String units) {
this.units = units;
}
@Column(name="warehousename",nullable=false,length=50)
public String getWarehousename() {
return warehousename;
}
public void setWarehousename(String warehousename) {
this.warehousename = warehousename;
}
@Column(name="supplier",nullable=false,length=50)
public String getSupplier() {
return supplier;
}
public void setSupplier(String supplier) {
this.supplier = supplier;
}
@Column(name="types",nullable=false,length=50)
public String getTypes() {
return types;
}
public void setTypes(String types) {
this.types = types;
}
@Column(name="PICTURES",nullable=false,length=50)
public String getPictures() {
return pictures;
}
public void setPictures(String pictures) {
this.pictures = pictures;
}
@Column(name="THEWAREHOUSEPEOPLE",nullable=false,length=50)
public String getThewarehousepeople() {
return thewarehousepeople;
}
public void setThewarehousepeople(String thewarehousepeople) {
this.thewarehousepeople = thewarehousepeople;
}
@Column(name="THESTORAGETIME",nullable=false,length=50)
public String getThestoragetime() {
return thestoragetime;
}
public void setThestoragetime(String thestoragetime) {
this.thestoragetime = thestoragetime;
}
@Column(name="LASTBORROWER",nullable=false,length=50)
public String getLastborrower() {
return lastborrower;
}
public void setLastborrower(String lastborrower) {
this.lastborrower = lastborrower;
}
@Column(name="LASTBORROWTIME",nullable=false,length=50)
public String getLastborrowtime() {
return lastborrowtime;
}
public void setLastborrowtime(String lastborrowtime) {
this.lastborrowtime = lastborrowtime;
}
@Column(name="REMARKS",nullable=false,length=50)
public String getRemarks() {
return remarks;
}
public void setRemarks(String remarks) {
this.remarks = remarks;
}
以上是 通过页面添加数据的时候could not resolve property: name of:“包名”(急,我已经研究了两天了) 的全部内容, 来源链接: utcz.com/p/179251.html