hibernate中类not mapped问题

spring项目中,用到hibernate mapping。后台写完之后junit test可以跑通,数据库可以存取数据,但是页面数据传过来之后,hql报错。已经仔细检查过hql中是查询的是类名还是表名以及各项配置,hpl中查询的是map过的类名。单元测试跑得通,所以xml配置应该也没错。但是页面存取数据的时候会报错。仔细检查过hql的大小写,全半角以及空格是否为中文空格,依然不能解决问题。希望各路高人给指条明路,感激不尽。。

报错内容:[code=text]
Caused by: org.hibernate.hql.ast.QuerySyntaxException: User is not mapped [from User where userName=?]
[/code]

具体的配置如下。

实体类:[code=java]
package com.huatek.cloud.usercenter.entity;

import com.huatek.framework.entity.FwAccount;

public class User extends FwAccount{

private static final long serialVersionUID = 6736542524764495567L;

private String seqNum;                              //数据的序列号,数据库中主键(id)。由于BaseServiceImpl中存在id字段,故重命名

private String userName;                            //用户名字段。如果注册方式为邮箱则它的值为email值;注册方式为手机则值为cellphone值

private String email;                               //用户的邮箱地址字段

private String cellphone;                           //用户的手机号字段

private int regType;                                //用户的注册类型字段

private String password;                            //用户的密码字段

private int activated;                          //用户的“是否激活”字段

private String validateCode;                        //用户的激活码字段

private java.sql.Timestamp registerTime;                            //用户的注册时间字段


//getter、setter方法略

}
[/code]

类与表的映射文件:User.hbm.xml
[code=text]

import 实体类所在的package;

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<class name = "User" table="t_register">

    <id name="seqNum" type="java.lang.String" column="id" length="100"></id>

    <property name="userName" column="name" type="java.lang.String" length="30"></property>

    <property name="email" column="email" type="java.lang.String" length="50"></property>

    <property name="cellphone" column="phone" type="java.lang.String" length="11"></property>

    <property name="regType" column="regType" type="java.lang.Integer" length="1"></property>

    <property name="password" column="password" type="java.lang.String" length="50"></property>

    <property name="activated" column="status" type="java.lang.Integer" length="1"></property>

    <property name="validateCode" column="validateCode" type="java.lang.String" length="100"></property>

    <property name="registerTime" column="registerTime" type="java.sql.Timestamp" length="100"></property>


</class>


[/code]

配置映射文件:application-base.xml
[code=text]
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">

    <property name="mappingLocations">
        <list>
            <!-- base frame -->
            <value>classpath*:/com/huatek/framework/hibernate/maps/oracle/*.hbm.xml
            </value>
            <!-- data dictionary -->
            <value>classpath*:/com/huatek/dictionary/hibernate/oracle/*.hbm.xml
            </value>
            <!-- data authority -->
            <value>classpath*:/com/huatek/authority/hibernate/oracle/*.hbm.xml
            </value>
            <!-- cloud authority -->
                <value>classpath*:/com/huatek/cloud/usercenter/hibernate/mysql/*.hbm.xml
            </value>
        </list>
    </property>
    <property name="hibernateProperties">
        <props>
            <prop key="hibernate.dialect">${hibernate.dialect}</prop>
            <prop key="hibernate.show_sql">false</prop>
            <prop key="hibernate.format_sql">true</prop>
            <prop key="hibernate.generate_statistics">false</prop>
            <prop key="hibernate.default_batch_fetch_size">30</prop>
        </props>
    </property>
    <!-- <property name="lobHandler"> <ref local="oracleLobHandler" /> </property> -->
    <property name="eventListeners">
        <map>
            <entry key="merge">
                <bean
                    class="org.springframework.orm.hibernate3.support.IdTransferringMergeEventListener" />
            </entry>
        </map>
    </property>
</bean>

[/code]

服务层中的实现方法,实际是就是判断userName是否已经存在库中以实现判断用户名重复:
[code=java]
@Override
public boolean cmpUserName(int regType, String userName) {

    String hql = "from User where userName=?";
    @SuppressWarnings("unchecked")
    List<User> resultUser = hibernateTemplate.find(hql,userName);  //每次debug单步跟进到这里报错

    if (resultUser.isEmpty())
         return userNameNotDup;
     else
         return userNameDup;
}

[/code]

6个回答

tangruiming
tangruiming 亲,我查询的就是类名不是表名哈,我知道肯定不能查表名啦,问题是单元测试都跑得通,但是页面数据传过来就报错,郁闷
接近 5 年之前 回复

你的User是一个继承类,需要添加继承类的映射。一般可以通过几种方式映射,subclass,joined-subclass,union-subclass。

tangruiming
tangruiming 我是用的别人的框架,担心以后要用到框架里面的东西,所以继承了一下。实际上我没用到框架里实体类相关的东西,打算以后要是有用到再说。刚才把继承关系去除了,还是一样的报错呀。。。
接近 5 年之前 回复

类和表的映射文件中class标签的nqme属性应该写全类名

tangruiming
tangruiming 你的意思是把绝对路径写完吗?我试了把路径写全,class = "com.xxxx.xxx.xxx.xxx.User",依旧报错呀。。
接近 5 年之前 回复

这个问题看似很简单,意思很容易理解说实体没有进行映射。在网上找了很多解决方法说是因为写hql时要对应的实体类的名字而不是表明。但是分析自己的代码应该没问题才是。但是我发现自己注释时 是这样写的,

自己给自己的实体取了个名字,因此我们在写HQL时要用自己所取的名字。果然将hql修改后,程序仅能正常运行。

总结:遇到问题是要具体问题具体解决,网上的解决方式是给自己的一个指引。我们不要一......
答案就在这里:hibernate:XXX is not mapped问题的解决
----------------------你好,人类,我是来自CSDN星球的问答机器人小C,以上是依据我对问题的理解给出的答案,如果解决了你的问题,望采纳。

最悲剧的是,我的东西提交上去,别人荡下来可以跑得通,我把工程彻底从硬盘上删除再荡下来,还是一样的问题。。。user is not mapped..报错位置就是hql

最悲剧的是,我的东西提交上去,别人荡下来可以跑得通,我把工程彻底从硬盘上删除再荡下来,还是一样的问题。。。user is not mapped..报错位置就是hql

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
hibernate 提示is not mapped

使用hibernate报错 ![图片说明](https://img-ask.csdn.net/upload/201610/16/1476608988_956036.jpg) ![图片说明](https://img-ask.csdn.net/upload/201610/16/1476609010_875852.jpg) 但是上图更改为下图,即可不报错 ![图片说明](https://img-ask.csdn.net/upload/201610/16/1476609097_309978.jpg) 请问要如何解决。

关于Hibernate 中出现 XXXX is not mapped 问题

网上都说是hibernate里针对实体类查询,比如user表,实体类为User,则hql语句应该是“from User u where u.uid=?”这样,大多错误都是因为User写成了表名user。 我已经仔细检查了许多遍,我的情况不是这个。 hql语句已经修改好,但仍然报Category is not mapped 下面贴一下代码,求大神指点一下。 Category实体类: ``` package com.models; public class Category { private String cid; private String cname; public String getCid() { return cid; } public void setCid(String cid) { this.cid = cid; } public String getCname() { return cname; } public void setCname(String cname) { this.cname = cname; } } ``` 映射文件: ``` <?xml version="1.0"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> <!-- Generated 2018-12-4 14:57:10 by Hibernate Tools 3.5.0.Final --> <hibernate-mapping> <class name="com.models.Category" table="CATEGORY"> <id name="cid" type="java.lang.String"> <column name="cid" /> <generator class="native" /> </id> <property name="cname" type="java.lang.String"> <column name="canme" /> </property> </class> </hibernate-mapping> ``` hibernate配置文件: ``` <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <session-factory name="sessionFactory"> <property name="hibernate.connection.driver_class">org.gjt.mm.mysql.Driver</property> <property name="hibernate.connection.password">123456</property> <property name="hibernate.connection.url">jdbc:mysql:///bookstore</property> <property name="hibernate.connection.username">root</property> <property name="hibernate.dialect">org.hibernate.dialect.MySQL5InnoDBDialect</property> <property name="show_sql">true</property> <mapping resource="com/models/User.hbm.xml"/> <mapping resource="com/models/Product.hbm.xml"/> <mapping resource="com/models/Order.hbm.xml"/> <mapping resource="com/models/OrderItem.hbm.xml"/> <mapping resource="com/models/Category.hbm.xml"/> </session-factory> </hibernate-configuration> ``` CategoryDao方法: ``` ······ public Category findById(String cid) throws Exception { // TODO Auto-generated method stub QueryRunner qr = new QueryRunner(DataSourceUtils.getDataSource()); String hql = "from Category where cid = ?"; BaseDaoImpl<Category> bdi=new BaseDaoImpl<Category>(); String[] param= {cid}; return bdi.findOne(hql, param); } ············ ``` 报错信息: Message org.hibernate.hql.internal.ast.QuerySyntaxException: Category is not mapped [from Category where cid = ?] Description The server encountered an unexpected condition that prevented it from fulfilling the request. Exception java.lang.IllegalArgumentException: org.hibernate.hql.internal.ast.QuerySyntaxException: Category is not mapped [from Category where cid = ?] org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:138) org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:181) org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:188) org.hibernate.internal.AbstractSharedSessionContract.createQuery(AbstractSharedSessionContract.java:713) org.hibernate.internal.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:23) com.dao.impl.BaseDaoImpl.findOne(BaseDaoImpl.java:128) com.dao.impl.CategoryDaoImpl.findById(CategoryDaoImpl.java:44) com.actions.AdminCategoryAction.findById(AdminCategoryAction.java:81) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) java.lang.reflect.Method.invoke(Unknown Source) ognl.OgnlRuntime.invokeMethod(OgnlRuntime.java:897) ognl.OgnlRuntime.callAppropriateMethod(OgnlRuntime.java:1299) ognl.ObjectMethodAccessor.callMethod(ObjectMethodAccessor.java:68) com.opensymphony.xwork2.ognl.accessor.XWorkMethodAccessor.callMethodWithDebugInfo(XWorkMethodAccessor.java:117) com.opensymphony.xwork2.ognl.accessor.XWorkMethodAccessor.callMethod(XWorkMethodAccessor.java:108) ognl.OgnlRuntime.callMethod(OgnlRuntime.java:1375) ognl.ASTMethod.getValueBody(ASTMethod.java:91) ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:212) ognl.SimpleNode.getValue(SimpleNode.java:258) ognl.Ognl.getValue(Ognl.java:470) ognl.Ognl.getValue(Ognl.java:434) com.opensymphony.xwork2.ognl.OgnlUtil$3.execute(OgnlUtil.java:398) com.opensymphony.xwork2.ognl.OgnlUtil.compileAndExecuteMethod(OgnlUtil.java:450) com.opensymphony.xwork2.ognl.OgnlUtil.callMethod(OgnlUtil.java:396) com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:430) com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:290) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:251) org.apache.struts2.interceptor.DeprecationInterceptor.intercept(DeprecationInterceptor.java:41) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:245) org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:256) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:245) com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:168) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:245) com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:265) org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:76) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:245) com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:138) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:245) com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:229) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:245) com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:229) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:245) com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:191) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:245) org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:73) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:245) org.apache.struts2.interceptor.DateTextFieldInterceptor.intercept(DateTextFieldInterceptor.java:125) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:245) org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:91) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:245) org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:253) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:245) com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:100) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:245) com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:141) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:245) com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:145) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:245) com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:171) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:245) com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:140) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:245) org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:245) com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:193) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:245) com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:189) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:245) org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:54) org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:575) org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:81) org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:99) Root Cause org.hibernate.hql.internal.ast.QuerySyntaxException: Category is not mapped [from Category where cid = ?] org.hibernate.hql.internal.ast.QuerySyntaxException.generateQueryException(QuerySyntaxException.java:79) org.hibernate.QueryException.wrapWithQueryString(QueryException.java:103) org.hibernate.hql.internal.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:219) org.hibernate.hql.internal.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:143) org.hibernate.engine.query.spi.HQLQueryPlan.<init>(HQLQueryPlan.java:119) org.hibernate.engine.query.spi.HQLQueryPlan.<init>(HQLQueryPlan.java:80) org.hibernate.engine.query.spi.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:153) org.hibernate.internal.AbstractSharedSessionContract.getQueryPlan(AbstractSharedSessionContract.java:595) org.hibernate.internal.AbstractSharedSessionContract.createQuery(AbstractSharedSessionContract.java:704) org.hibernate.internal.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:23) com.dao.impl.BaseDaoImpl.findOne(BaseDaoImpl.java:128) com.dao.impl.CategoryDaoImpl.findById(CategoryDaoImpl.java:44) com.actions.AdminCategoryAction.findById(AdminCategoryAction.java:81) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) java.lang.reflect.Method.invoke(Unknown Source) ognl.OgnlRuntime.invokeMethod(OgnlRuntime.java:897) ognl.OgnlRuntime.callAppropriateMethod(OgnlRuntime.java:1299) ognl.ObjectMethodAccessor.callMethod(ObjectMethodAccessor.java:68) com.opensymphony.xwork2.ognl.accessor.XWorkMethodAccessor.callMethodWithDebugInfo(XWorkMethodAccessor.java:117) com.opensymphony.xwork2.ognl.accessor.XWorkMethodAccessor.callMethod(XWorkMethodAccessor.java:108) ognl.OgnlRuntime.callMethod(OgnlRuntime.java:1375) ognl.ASTMethod.getValueBody(ASTMethod.java:91) ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:212) ognl.SimpleNode.getValue(SimpleNode.java:258) ognl.Ognl.getValue(Ognl.java:470) ognl.Ognl.getValue(Ognl.java:434) com.opensymphony.xwork2.ognl.OgnlUtil$3.execute(OgnlUtil.java:398) com.opensymphony.xwork2.ognl.OgnlUtil.compileAndExecuteMethod(OgnlUtil.java:450) com.opensymphony.xwork2.ognl.OgnlUtil.callMethod(OgnlUtil.java:396) com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:430) com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:290) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:251) org.apache.struts2.interceptor.DeprecationInterceptor.intercept(DeprecationInterceptor.java:41) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:245) org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:256) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:245) com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:168) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:245) com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:265) org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:76) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:245) com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:138) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:245) com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:229) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:245) com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:229) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:245) com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:191) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:245) org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:73) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:245) org.apache.struts2.interceptor.DateTextFieldInterceptor.intercept(DateTextFieldInterceptor.java:125) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:245) org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:91) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:245) org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:253) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:245) com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:100) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:245) com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:141) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:245) com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:145) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:245) com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:171) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:245) com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:140) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:245) org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:245) com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:193) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:245) com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:189) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:245) org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:54) org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:575) org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:81) org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:99) Root Cause org.hibernate.hql.internal.ast.QuerySyntaxException: Category is not mapped org.hibernate.hql.internal.ast.util.SessionFactoryHelper.requireClassPersister(SessionFactoryHelper.java:169) org.hibernate.hql.internal.ast.tree.FromElementFactory.addFromElement(FromElementFactory.java:91) org.hibernate.hql.internal.ast.tree.FromClause.addFromElement(FromClause.java:79) org.hibernate.hql.internal.ast.HqlSqlWalker.createFromElement(HqlSqlWalker.java:331) org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.fromElement(HqlSqlBaseWalker.java:3695) org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.fromElementList(HqlSqlBaseWalker.java:3584) org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.fromClause(HqlSqlBaseWalker.java:720) org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:576) org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:313) org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:261) org.hibernate.hql.internal.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:271) org.hibernate.hql.internal.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:191) org.hibernate.hql.internal.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:143) org.hibernate.engine.query.spi.HQLQueryPlan.<init>(HQLQueryPlan.java:119) org.hibernate.engine.query.spi.HQLQueryPlan.<init>(HQLQueryPlan.java:80) org.hibernate.engine.query.spi.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:153) org.hibernate.internal.AbstractSharedSessionContract.getQueryPlan(AbstractSharedSessionContract.java:595) org.hibernate.internal.AbstractSharedSessionContract.createQuery(AbstractSharedSessionContract.java:704) org.hibernate.internal.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:23) com.dao.impl.BaseDaoImpl.findOne(BaseDaoImpl.java:128) com.dao.impl.CategoryDaoImpl.findById(CategoryDaoImpl.java:44) com.actions.AdminCategoryAction.findById(AdminCategoryAction.java:81) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) java.lang.reflect.Method.invoke(Unknown Source) ognl.OgnlRuntime.invokeMethod(OgnlRuntime.java:897) ognl.OgnlRuntime.callAppropriateMethod(OgnlRuntime.java:1299) ognl.ObjectMethodAccessor.callMethod(ObjectMethodAccessor.java:68) com.opensymphony.xwork2.ognl.accessor.XWorkMethodAccessor.callMethodWithDebugInfo(XWorkMethodAccessor.java:117) com.opensymphony.xwork2.ognl.accessor.XWorkMethodAccessor.callMethod(XWorkMethodAccessor.java:108) ognl.OgnlRuntime.callMethod(OgnlRuntime.java:1375) ognl.ASTMethod.getValueBody(ASTMethod.java:91) ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:212) ognl.SimpleNode.getValue(SimpleNode.java:258) ognl.Ognl.getValue(Ognl.java:470) ognl.Ognl.getValue(Ognl.java:434) com.opensymphony.xwork2.ognl.OgnlUtil$3.execute(OgnlUtil.java:398) com.opensymphony.xwork2.ognl.OgnlUtil.compileAndExecuteMethod(OgnlUtil.java:450) com.opensymphony.xwork2.ognl.OgnlUtil.callMethod(OgnlUtil.java:396) com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:430) com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:290) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:251) org.apache.struts2.interceptor.DeprecationInterceptor.intercept(DeprecationInterceptor.java:41) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:245) org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:256) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:245) com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:168) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:245) com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:265) org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:76) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:245) com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:138) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:245) com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:229) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:245) com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:229) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:245) com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:191) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:245) org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:73) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:245) org.apache.struts2.interceptor.DateTextFieldInterceptor.intercept(DateTextFieldInterceptor.java:125) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:245) org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:91) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:245) org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:253) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:245) com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:100) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:245) com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:141) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:245) com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:145) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:245) com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:171) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:245) com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:140) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:245) org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:245) com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:193) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:245) com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:189) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:245) org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:54) org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:575) org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:81) org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:99) Note The full stack trace of the root cause is available in the server logs.

菜鸟求教Hibernate之 User is not mapped

映射是有的![图片说明](https://img-ask.csdn.net/upload/201601/17/1453034007_734963.png) 实体类的注解: ![图片说明](https://img-ask.csdn.net/upload/201601/17/1453034034_880433.png) 使用session.createCriteria(User.class);是没有任何问题的 使用session.createQuery("from User")就报错User is not mapped 求教!!

hibernate注入映射可以save(),但是查询报is not mapped错误

![图片说明](https://img-ask.csdn.net/upload/201706/08/1496897519_808692.png)![![![图片说明](https://img-ask.csdn.net/upload/201706/08/1496897561_745969.png)图片说明](https://img-ask.csdn.net/upload/201706/08/1496897554_726220.png)图片说明](https://img-ask.csdn.net/upload/201706/08/1496897529_611567.png)

Spring Boot 使用JPA连接MySQL数据库报错 is not mapped

小白向各位大侠求助: 创建Spring Boot 工程时,使用JPA连接MySQL数据库,查询时报错,报错信息如下: ``` 2018-06-04 06:34:44.959 ERROR 6116 --- [nio-8080-exec-2] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.dao.InvalidDataAccessApiUsageException: org.hibernate.hql.internal.ast.QuerySyntaxException: Person is not mapped [select t from Person t]; nested exception is java.lang.IllegalArgumentException: org.hibernate.hql.internal.ast.QuerySyntaxException: Person is not mapped [select t from Person t]] with root cause org.hibernate.hql.internal.ast.QuerySyntaxException: Person is not mapped at org.hibernate.hql.internal.ast.util.SessionFactoryHelper.requireClassPersister(SessionFactoryHelper.java:169) ~[hibernate-core-5.2.17.Final.jar:5.2.17.Final] at org.hibernate.hql.internal.ast.tree.FromElementFactory.addFromElement(FromElementFactory.java:91) ~[hibernate-core-5.2.17.Final.jar:5.2.17.Final] at org.hibernate.hql.internal.ast.tree.FromClause.addFromElement(FromClause.java:79) ~[hibernate-core-5.2.17.Final.jar:5.2.17.Final] at org.hibernate.hql.internal.ast.HqlSqlWalker.createFromElement(HqlSqlWalker.java:326) ~[hibernate-core-5.2.17.Final.jar:5.2.17.Final] at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.fromElement(HqlSqlBaseWalker.java:3706) ~[hibernate-core-5.2.17.Final.jar:5.2.17.Final] at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.fromElementList(HqlSqlBaseWalker.java:3595) ~[hibernate-core-5.2.17.Final.jar:5.2.17.Final] at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.fromClause(HqlSqlBaseWalker.java:720) ~[hibernate-core-5.2.17.Final.jar:5.2.17.Final] at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:576) ~[hibernate-core-5.2.17.Final.jar:5.2.17.Final] at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:313) ~[hibernate-core-5.2.17.Final.jar:5.2.17.Final] at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:261) ~[hibernate-core-5.2.17.Final.jar:5.2.17.Final] at org.hibernate.hql.internal.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:266) ~[hibernate-core-5.2.17.Final.jar:5.2.17.Final] at org.hibernate.hql.internal.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:189) ~[hibernate-core-5.2.17.Final.jar:5.2.17.Final] at org.hibernate.hql.internal.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:141) ~[hibernate-core-5.2.17.Final.jar:5.2.17.Final] at org.hibernate.engine.query.spi.HQLQueryPlan.<init>(HQLQueryPlan.java:115) ~[hibernate-core-5.2.17.Final.jar:5.2.17.Final] at org.hibernate.engine.query.spi.HQLQueryPlan.<init>(HQLQueryPlan.java:77) ~[hibernate-core-5.2.17.Final.jar:5.2.17.Final] at org.hibernate.engine.query.spi.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:153) ~[hibernate-core-5.2.17.Final.jar:5.2.17.Final] at org.hibernate.internal.AbstractSharedSessionContract.getQueryPlan(AbstractSharedSessionContract.java:553) ~[hibernate-core-5.2.17.Final.jar:5.2.17.Final] at org.hibernate.internal.AbstractSharedSessionContract.createQuery(AbstractSharedSessionContract.java:662) ~[hibernate-core-5.2.17.Final.jar:5.2.17.Final] at org.hibernate.internal.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:23) ~[hibernate-core-5.2.17.Final.jar:5.2.17.Final] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_131] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_131] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_131] at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_131] at org.springframework.orm.jpa.ExtendedEntityManagerCreator$ExtendedEntityManagerInvocationHandler.invoke(ExtendedEntityManagerCreator.java:350) ~[spring-orm-5.0.6.RELEASE.jar:5.0.6.RELEASE] at com.sun.proxy.$Proxy76.createQuery(Unknown Source) ~[na:na] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_131] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_131] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_131] at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_131] at org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:304) ~[spring-orm-5.0.6.RELEASE.jar:5.0.6.RELEASE] at com.sun.proxy.$Proxy76.createQuery(Unknown Source) ~[na:na] at com.neuqsoft.demo.repository.impl.PersonDaoImpl.findAll(PersonDaoImpl.java:52) ~[classes/:na] at com.neuqsoft.demo.repository.impl.PersonDaoImpl$$FastClassBySpringCGLIB$$7895840c.invoke(<generated>) ~[classes/:na] at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) ~[spring-core-5.0.6.RELEASE.jar:5.0.6.RELEASE] at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:746) ~[spring-aop-5.0.6.RELEASE.jar:5.0.6.RELEASE] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[spring-aop-5.0.6.RELEASE.jar:5.0.6.RELEASE] at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:139) ~[spring-tx-5.0.6.RELEASE.jar:5.0.6.RELEASE] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185) ~[spring-aop-5.0.6.RELEASE.jar:5.0.6.RELEASE] at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688) ~[spring-aop-5.0.6.RELEASE.jar:5.0.6.RELEASE] at com.neuqsoft.demo.repository.impl.PersonDaoImpl$$EnhancerBySpringCGLIB$$182f86eb.findAll(<generated>) ~[classes/:na] at com.neuqsoft.demo.service.PersonService.findAll(PersonService.java:50) ~[classes/:na] at com.neuqsoft.demo.controller.PersonController.getPseronList(PersonController.java:59) ~[classes/:na] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_131] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_131] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_131] at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_131] at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:209) ~[spring-web-5.0.6.RELEASE.jar:5.0.6.RELEASE] at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:136) ~[spring-web-5.0.6.RELEASE.jar:5.0.6.RELEASE] at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:102) ~[spring-webmvc-5.0.6.RELEASE.jar:5.0.6.RELEASE] at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:877) ~[spring-webmvc-5.0.6.RELEASE.jar:5.0.6.RELEASE] at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:783) ~[spring-webmvc-5.0.6.RELEASE.jar:5.0.6.RELEASE] at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) ~[spring-webmvc-5.0.6.RELEASE.jar:5.0.6.RELEASE] at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:991) ~[spring-webmvc-5.0.6.RELEASE.jar:5.0.6.RELEASE] at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:925) ~[spring-webmvc-5.0.6.RELEASE.jar:5.0.6.RELEASE] at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:974) ~[spring-webmvc-5.0.6.RELEASE.jar:5.0.6.RELEASE] at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:866) ~[spring-webmvc-5.0.6.RELEASE.jar:5.0.6.RELEASE] at javax.servlet.http.HttpServlet.service(HttpServlet.java:635) ~[tomcat-embed-core-8.5.31.jar:8.5.31] at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:851) ~[spring-webmvc-5.0.6.RELEASE.jar:5.0.6.RELEASE] at javax.servlet.http.HttpServlet.service(HttpServlet.java:742) ~[tomcat-embed-core-8.5.31.jar:8.5.31] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) ~[tomcat-embed-core-8.5.31.jar:8.5.31] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-8.5.31.jar:8.5.31] at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) ~[tomcat-embed-websocket-8.5.31.jar:8.5.31] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-8.5.31.jar:8.5.31] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-8.5.31.jar:8.5.31] at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99) ~[spring-web-5.0.6.RELEASE.jar:5.0.6.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.0.6.RELEASE.jar:5.0.6.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-8.5.31.jar:8.5.31] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-8.5.31.jar:8.5.31] at org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:109) ~[spring-web-5.0.6.RELEASE.jar:5.0.6.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.0.6.RELEASE.jar:5.0.6.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-8.5.31.jar:8.5.31] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-8.5.31.jar:8.5.31] at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:81) ~[spring-web-5.0.6.RELEASE.jar:5.0.6.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.0.6.RELEASE.jar:5.0.6.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-8.5.31.jar:8.5.31] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-8.5.31.jar:8.5.31] at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200) ~[spring-web-5.0.6.RELEASE.jar:5.0.6.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.0.6.RELEASE.jar:5.0.6.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-8.5.31.jar:8.5.31] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-8.5.31.jar:8.5.31] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198) ~[tomcat-embed-core-8.5.31.jar:8.5.31] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) [tomcat-embed-core-8.5.31.jar:8.5.31] at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:496) [tomcat-embed-core-8.5.31.jar:8.5.31] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) [tomcat-embed-core-8.5.31.jar:8.5.31] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81) [tomcat-embed-core-8.5.31.jar:8.5.31] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) [tomcat-embed-core-8.5.31.jar:8.5.31] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342) [tomcat-embed-core-8.5.31.jar:8.5.31] at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:803) [tomcat-embed-core-8.5.31.jar:8.5.31] at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) [tomcat-embed-core-8.5.31.jar:8.5.31] at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:790) [tomcat-embed-core-8.5.31.jar:8.5.31] at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1468) [tomcat-embed-core-8.5.31.jar:8.5.31] at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-embed-core-8.5.31.jar:8.5.31] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_131] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_131] at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-8.5.31.jar:8.5.31] at java.lang.Thread.run(Thread.java:748) [na:1.8.0_131] ``` 实体文件: ``` @Entity @Table(name = "person") public class Person { @Id @GeneratedValue(strategy = GenerationType.AUTO) private String id; @Column(name="name") private String name; @Column(name="sex") private String sex; @Column(name="tel") private String tel; @Column(name="address") private String address; @Column(name="age") private String age; public String getId() { return id; } public void setId(String id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getSex() { return sex; } public void setSex(String sex) { this.sex = sex; } public String getTel() { return tel; } public void setTel(String tel) { this.tel = tel; } public String getAddress() { return address; } public void setAddress(String address) { this.address = address; } public String getAge() { return age; } public void setAge(String age) { this.age = age; } } ``` 数据库表: ![图片说明](https://img-ask.csdn.net/upload/201806/04/1528064584_339931.jpg) DAO文件: ``` package com.neuqsoft.demo.repository.impl; import java.util.List; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Repository; import com.neuqsoft.demo.entity.Person; import com.neuqsoft.demo.repository.PersonDao; @Repository public class PersonDaoImpl implements PersonDao { @Autowired @PersistenceContext private EntityManager entityManager; @Override public List<Person> findAll() { return this.entityManager.createQuery("select t from Person t").getResultList(); } } ``` Pom.xml ``` <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.neuqsoft</groupId> <artifactId>DemoJPAForSpringBoot</artifactId> <version>0.0.1-SNAPSHOT</version> <packaging>war</packaging> <name>DemoJPAForSpringBoot</name> <description>Demo project for Spring Boot</description> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.0.2.RELEASE</version> <relativePath/> <!-- lookup parent from repository --> </parent> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <java.version>1.8</java.version> </properties> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-jpa</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <scope>runtime</scope> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-tomcat</artifactId> <scope>provided</scope> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> <!-- custom renw --> <dependency> <groupId>com.alibaba</groupId> <artifactId>druid</artifactId> <version>1.1.0</version> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> </plugins> </build> </project> ``` application.properties: ``` #mysql #datasource spring.datasource.driver-class-name=com.mysql.jdbc.Driver spring.datasource.url=jdbc:mysql://localhost:3306/forspringboot?useSSL=false spring.datasource.username=root spring.datasource.password=1qaz!QAZ spring.jpa.show-sql= true ```

使用springmvc注解报Forecast is not mapped

添加数据都能成功,就是查询是报错 进入query 2015-1-9 10:50:33 org.apache.catalina.core.StandardWrapperValve invoke 严重: Servlet.service() for servlet springMVC threw exception org.hibernate.hql.internal.ast.QuerySyntaxException: Forecast is not mapped at org.hibernate.hql.internal.ast.util.SessionFactoryHelper.requireClassPersister(SessionFactoryHelper.java:189) at org.hibernate.hql.internal.ast.tree.FromElementFactory.addFromElement(FromElementFactory.java:109) at org.hibernate.hql.internal.ast.tree.FromClause.addFromElement(FromClause.java:95) at org.hibernate.hql.internal.ast.HqlSqlWalker.createFromElement(HqlSqlWalker.java:331) at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.fromElement(HqlSqlBaseWalker.java:3633) at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.fromElementList(HqlSqlBaseWalker.java:3522) at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.fromClause(HqlSqlBaseWalker.java:706) at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:562) at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:299) at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:247) at org.hibernate.hql.internal.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:278) at org.hibernate.hql.internal.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:206) at org.hibernate.hql.internal.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:158) at org.hibernate.engine.query.spi.HQLQueryPlan.<init>(HQLQueryPlan.java:126) at org.hibernate.engine.query.spi.HQLQueryPlan.<init>(HQLQueryPlan.java:88) at org.hibernate.engine.query.spi.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:190) at org.hibernate.internal.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:301) at org.hibernate.internal.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:236) at org.hibernate.internal.SessionImpl.createQuery(SessionImpl.java:1796) at com.lesogo.dao.ForecastDao.queryForecast(ForecastDao.java:44) at com.lesogo.dao.ForecastDao$$FastClassBySpringCGLIB$$76bb1b77.invoke(<generated>) at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:711) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:136) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:644) at com.lesogo.dao.ForecastDao$$EnhancerBySpringCGLIB$$2d6f7fda.queryForecast(<generated>) at com.lesogo.controller.AirController.queryForecast(AirController.java:39) 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) 1.dao层 @Repository public class ForecastDao { @Autowired private SessionFactory sessionFactory; //添加预报信息 public boolean addForecast(Forecast forecast) { System.out.println("进入add"); Session session=sessionFactory.openSession(); Transaction t=session.beginTransaction(); session.save(forecast); t.commit(); session.close(); return false; } //查询预报信息 public List<Forecast> queryForecast() { System.out.println("进入query"); Session session=sessionFactory.openSession(); Transaction t=session.beginTransaction(); //HQL查询语句 String hql="from Forecast"; Query query=session.createQuery(hql); List<Forecast> list=query.list(); t.commit(); session.close(); return list; } 实体 @Entity(name="forecast") @Resource public class Forecast implements Serializable { private int forecastId;//预报编号 private String forecastArea;//预报区县 private String forecastTime;//预报时间 private String forecastAir;//天气 private int temperature;//温度 private int humidity;//湿度 private float windSpeed;//风速 private String windDirection;//风向 private float capacity;//降雨量 private float totalCould;//总云量 private float lowCapacity;//低动量 @Id @GeneratedValue public int getForecastId() { return forecastId; } public void setForecastId(int forecastId) { this.forecastId = forecastId; } @Column(name="forecast_area") public String getForecastArea() { return forecastArea; } public void setForecastArea(String forecastArea) { this.forecastArea = forecastArea; } @Column(name="forecast_time") public String getForecastTime() { return forecastTime; } public void setForecastTime(String forecastTime) { this.forecastTime = forecastTime; }

Hibernate实体类中属性的映射

我的实体类的其中一个属性的类型是InputStream,映射文件中type要为什么?可以是mediumblob吗?

person is not mapped--.整合Hibernate出现错误

![图片说明](https://img-ask.csdn.net/upload/201701/17/1484652034_588783.png) import org.hibernate.annotations.GenericGenerator; import javax.persistence.*; /** * Created by on 2017/1/16. */ @Entity @Table(name="person") public class Person { private String id; private String name; private String idCard; private String phone; private String address; @Id @Column(name = "id",nullable = false,length = 32,unique = true) @GenericGenerator(name = "generator",strategy = "uuid.hex") @GeneratedValue(generator = "generator") public String getId() { return id; } public void setId(String id) { this.id = id; } @Column(name="name",nullable = false,length = 32) public String getName() { return name; } public void setName(String name) { this.name = name; } @Column(name="idCard",nullable = false,length = 32) public String getIdCard() { return idCard; } public void setIdCard(String idCard) { this.idCard = idCard; } @Column(name="phone",nullable = false,length = 32) public String getPhone() { return phone; } public void setPhone(String phone) { this.phone = phone; } @Column(name="address",nullable = false,length = 32) public String getAddress() { return address; } public void setAddress(String address) { this.address = address; } } ```![![图片说明](https://img-ask.csdn.net/upload/201701/17/1484630197_871861.png)图片说明](https://img-ask.csdn.net/upload/201701/17/1484630119_734619.png) ```

ssh框架中出现 XXXX is not mapped问题

1. 原本在使用项目的过程中用的好好的,因业务需要,又新增了表,之后就出现了 XXXX is not mapped问题。 1. 实体类有了、hbm.xml也配置了、在spring里也做好配置、hql好像也是对的,但就是一直报错。附上代码: 1. ![图片说明](https://img-ask.csdn.net/upload/202006/02/1591105112_446733.png) ``` <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> <hibernate-mapping> <class name="com.cms_fn.entity.drafts.Drafts" table="DRAFTS" dynamic-insert="true"> <id name="id" type="integer"> <column name="ID" /> <generator class="sequence"> <param name="sequence"> seq_drafts </param> </generator> </id> <many-to-one name="thirdItem" class="com.cms_fn.entity.thirdItem.ThirdItem" column="THIRDITEM_ID"></many-to-one> <many-to-one name="admin" class="com.cms_fn.entity.admin.Admin" column="ADMIN_ID"></many-to-one> <property name="headline" type="string"> <column name="HEADLINE" /> </property> <property name="title" type="string"> <column name="TITLE" /> </property> ``` 4. ``` select df from Drafts df join fetch df.admin a where 1=1 ``` 5 ![图片说明](https://img-ask.csdn.net/upload/202006/02/1591105324_35288.png) 6.在网上查找原因许久了,都说是要么没配置spring、要么是没有实体类、要么是hql没有写实体类,可是这些原因都排除了,不懂为什么还是不行,还是说有其他原因会导致报错。希望大家帮帮忙,帮忙解决下,弄了好久了。

springmvc+hibernate 实体类映射错误

![图片说明](https://img-ask.csdn.net/upload/201605/24/1464029829_418854.png)type Exception report message Request processing failed; nested exception is org.hibernate.hql.ast.QuerySyntaxException: Users is not mapped [from Users u where u.loginName='ss' and u.password='aa'] description The server encountered an internal error that prevented it from fulfilling this request. exception org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.hibernate.hql.ast.QuerySyntaxException: Users is not mapped [from Users u where u.loginName='ss' and u.password='aa'] org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:894) org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:789) javax.servlet.http.HttpServlet.service(HttpServlet.java:646) javax.servlet.http.HttpServlet.service(HttpServlet.java:727) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) root cause org.hibernate.hql.ast.QuerySyntaxException: Users is not mapped [from Users u where u.loginName='ss' and u.password='aa'] org.hibernate.hql.ast.util.SessionFactoryHelper.requireClassPersister(SessionFactoryHelper.java:158) org.hibernate.hql.ast.tree.FromElementFactory.addFromElement(FromElementFactory.java:87) org.hibernate.hql.ast.tree.FromClause.addFromElement(FromClause.java:70) org.hibernate.hql.ast.HqlSqlWalker.createFromElement(HqlSqlWalker.java:257) org.hibernate.hql.antlr.HqlSqlBaseWalker.fromElement(HqlSqlBaseWalker.java:3056) org.hibernate.hql.antlr.HqlSqlBaseWalker.fromElementList(HqlSqlBaseWalker.java:2945) org.hibernate.hql.antlr.HqlSqlBaseWalker.fromClause(HqlSqlBaseWalker.java:688) org.hibernate.hql.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:544) org.hibernate.hql.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:281) org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:229) org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:228) org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:160) org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:111) org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:77) org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:56) org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:72) org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:133) org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:112) org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1623) myplan.dao.impl.UserDaoImpl.login(UserDaoImpl.java:34) myplan.service.impl.UserServiceImpl.login(UserServiceImpl.java:21) myplan.action.UserController.login(UserController.java:28) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) java.lang.reflect.Method.invoke(Method.java:606) org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:213) org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:126) org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:96) org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:617) org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:578) org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80) org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:923) org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852) org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882) org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:789) javax.servlet.http.HttpServlet.service(HttpServlet.java:646) javax.servlet.http.HttpServlet.service(HttpServlet.java:727) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)![![图片说明](https://img-ask.csdn.net/upload/201605/24/1464029672_578711.png)图片说明](https://img-ask.csdn.net/upload/201605/24/1464029660_819473.png)

hibernate3.2 映射特殊映射问题.

我想做一个部门的实体类,想达到这样的目地,想用一个表完成上级部.还有他的下属部门!都在一个表里边映射.用递归办法去查询. 实体如下: public class Organization implements Serializable { private static final long serialVersionUID = 7501283407841925933L; private int id; private String name; private String sn; private String description; private Organization parent; private Set<Organization> children; } set,get方法不写了,Organization parent这个属性做最上级部门,Set<Organization> children属性做他下边的子部门 放到Set集合里边去! hibernate3.2映射文件如下: [b]<?xml version="1.0"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> <hibernate-mapping> <class name="com.oa.model.Organization" dynamic-update="true" dynamic-insert="true" batch-size="3"> <id name="id"> <generator class="native" /> </id> <property name="name" length="255" not-null="true" /> <property name="sn" not-null="true"/> <property name="description"/> <many-to-one column="pid" name="parent" class="com.oa.model.Organization" cascade="save-update"/> <set name="children" table="chlidrenOrg" inverse="true" cascade="save-update"> <key column="pid" /> <one-to-many class="com.oa.model.Organization"/> </set> </class> </hibernate-mapping> 请问能不能在一个实体里自已做多对一映射,我做了测试能正确存到数据库中去,但是取的时候Set集合是NULL,就是关联不上. 但是我看人家Hibernate3.3做的视频就可以正确取出数据来,我用的是hibernate3.2版本,取不出来set集合的东西. 以下是做Juint单元测试: public class OrgTest extends TestCase { Session session=null; public void testOrg1(){ try { session=HibernateUtil.currentSession(); session.beginTransaction(); Set<Organization> set= new HashSet<Organization>(); Organization org2=new Organization(); org2.setName("软件开发部"); org2.setSn("2"); set.add(org2); Organization org3=new Organization(); org3.setName("网络集成部门"); org3.setSn("3"); set.add(org3); Organization org4=new Organization(); org4.setName("销售部门"); org4.setSn("4"); set.add(org4); Organization org1=new Organization(); org1.setName("阳光科技有限公司"); org1.setSn("1"); //org1做为顶级部门把下级部门放到达Set集合里去; org1.setChildren(set); session.save(org1); session.save(org2); session.save(org3); session.save(org4); session.getTransaction().commit(); } catch (Exception e) { e.printStackTrace(); session.beginTransaction().rollback(); }finally{ HibernateUtil.closeSession(); } } public void testOrgLoad(){ Session session=null; try{ session=HibernateUtil.currentSession(); session.beginTransaction(); Organization org=(Organization) session.load(Organization.class,1); System.out.println(" 顶级部门名字:"+org.getName()+";"+"set集合的大小:"+org.getChildren().size()); Set<Organization> set=org.getChildren(); System.out.println(set.toString()); for(Organization org1 : set){ System.out.println(org1.getName()); } session.getTransaction().commit(); }catch(Exception e){ e.printStackTrace(); HibernateUtil.rollbackTransaction(); }finally{ HibernateUtil.closeSession(); } } } public void testOrg1()方法可以正确放入数据库,但是数据库里没有Pid关联,按上边的映射文件写的那样,应该Pid有关联的,但是数据库里没有? public void testOrgLoad()方法看一看能不能把顶级部门的下级部门取出来,可以结果如下: 顶级部门名字:阳光科技有限公司;set集合的大小:0 其实我早就想到是这个结果了,因为Pid没有关联上当然取不出来值了!但是想问一问上边的实体映射能不能自己映射呢! 看人家hibernate3.3视频做的一模一样,人家的能通过!!想知道结果

关于hibernateTemplate的问题

首先我的查询语句是这样写的:=====》 return this.getHibernateTemplate().find("from bean.Customer"); 然后报这个错:====》 org.springframework.orm.hibernate3.HibernateQueryException: bean.Customer is not mapped [from bean.Customer]; nested exception is org.hibernate.hql.ast.QuerySyntaxException: bean.Customer is not mapped [from bean.Customer] org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:657) org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:412) org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:424) org.springframework.orm.hibernate3.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:374) org.springframework.orm.hibernate3.HibernateTemplate.find(HibernateTemplate.java:921) org.springframework.orm.hibernate3.HibernateTemplate.find(HibernateTemplate.java:913) com.sxt.dao.CustomerDao.findAll(CustomerDao.java:47) ====这个47行就是我的那个查询语句

hibernate+DAO+JSP/Servlet,同样的查询在java类中测试成功,jsp中就失败(不是引用的问题)

用hibernate hql查询Shop对象映射,在java类中测试成功的,如下图:![图片说明](https://img-ask.csdn.net/upload/201802/24/1519456649_405992.png) 但是放到jsp中就不行了,报错:Shop not mapped如下图:![图片说明](https://img-ask.csdn.net/upload/201802/24/1519456820_940509.png)。我的猜测是hibernate.cfg.xml无法被这个jsp变成的servlet找到,如果是这个问题,我想问问该怎么解决?如果不是这个问题,那又该怎么解决?下图是我的项目结构,供参考![图片说明](https://img-ask.csdn.net/upload/201802/24/1519457015_980003.png)

pojo中的域并不在数据库中存在,hibernate如何定义

hibernate 映射的class的变量可以定义多于数据库中的域么?pojo中的域并不在数据库中存在,hibernate如何定义 即类似 grails中class定义中的transients属性 即:pojo中的值并不在数据库中存在 如中间变量或数据 当然,多添加个BO来做没问题,再赋值,再保存。感觉没必要而已。就如grails中,直接赋予transients属性就很简单 --------------- 搜索了下,貌似无解 http://jira.codehaus.org/browse/GRAILS-4978 与我提的问题有点反方向,但解答有关: In effect, transient properties are not part of Hibernate (annotation) mapping meta data and this appears to be very reasonable, as @Transient states just that Hibernate should completely ignore a particular property. Within org.codehaus.groovy.grails.orm.hibernate.GrailsHibernateDomainClass, Grails then uses these meta data to construct the properties of the persistent class. This will result in transient properties missing from the properties collection of a persistent class For your example, transientField will not be a member of myDomainInstance.properties but can still be accessed via myDomainInstance.transientField. As the scaffolding logic uses the properties from the persistent class, it will just not see any transient property. A fix might require GrailsHibernateDomainClass to introspect the persistent class on its own and to merge those properties with the properties from the meta class - provided there is a way to add properties that are not mapped by Hibernate. A work-around might be attempted by adding missing properties within application code, but I suspect it may not be a task for the faint of heart -------------------- 嘿嘿,貌似扩展个类,再upcasting就行了,试试看。----我自言自语ing

hibernate4.3报错是怎么回事?

2016-10-6 11:01:28 org.hibernate.annotations.common.reflection.java.JavaReflectionManager <clinit> INFO: HCANN000001: Hibernate Commons Annotations {4.0.5.Final} 2016-10-6 11:01:28 org.hibernate.Version logVersion INFO: HHH000412: Hibernate Core {4.3.11.Final} 2016-10-6 11:01:28 org.hibernate.cfg.Environment <clinit> INFO: HHH000206: hibernate.properties not found 2016-10-6 11:01:28 org.hibernate.cfg.Environment buildBytecodeProvider INFO: HHH000021: Bytecode provider name : javassist 2016-10-6 11:01:28 org.hibernate.cfg.Configuration configure INFO: HHH000043: Configuring from resource: /hibernate.cfg.xml 2016-10-6 11:01:28 org.hibernate.cfg.Configuration getConfigurationInputStream INFO: HHH000040: Configuration resource: /hibernate.cfg.xml 2016-10-6 11:01:28 org.hibernate.cfg.Configuration addResource INFO: HHH000221: Reading mappings from resource: com/zpp/pojo/User.hbm.xml 2016-10-6 11:01:29 org.hibernate.cfg.Configuration doConfigure INFO: HHH000041: Configured SessionFactory: null 2016-10-6 11:01:29 org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure WARN: HHH000402: Using Hibernate built-in connection pool (not for production use!) 2016-10-6 11:01:29 org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreator INFO: HHH000401: using driver [com.mysql.jdbc.Driver] at URL [jdbc:mysql://localhost:3306/hibernate4] 2016-10-6 11:01:29 org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreator INFO: HHH000046: Connection properties: {user=root, password=****} 2016-10-6 11:01:29 org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreator INFO: HHH000006: Autocommit mode: false 2016-10-6 11:01:29 org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure INFO: HHH000115: Hibernate connection pool size: 20 (min=1) 2016-10-6 11:01:29 org.hibernate.dialect.Dialect <init> INFO: HHH000400: Using dialect: org.hibernate.dialect.MySQLDialect 2016-10-6 11:01:29 org.hibernate.engine.jdbc.internal.LobCreatorBuilder useContextualLobCreation INFO: HHH000423: Disabling contextual LOB creation as JDBC driver reported JDBC version [3] less than 4 2016-10-6 11:01:29 org.hibernate.engine.transaction.internal.TransactionFactoryInitiator initiateService INFO: HHH000399: Using default transaction strategy (direct JDBC transactions) 2016-10-6 11:01:29 org.hibernate.hql.internal.ast.ASTQueryTranslatorFactory <init> INFO: HHH000397: Using ASTQueryTranslatorFactory

Hibernate insert出错!

<p> </p> <p> </p> <p>以下是错误信息!我用的是Oracle</p> <p>HTTP Status 500 -</p> <p> </p> <p>type Exception report</p> <p> </p> <p>message</p> <p> </p> <p>description The server encountered an internal error () that prevented it from fulfilling this request.</p> <p> </p> <p>exception</p> <p> </p> <p>org.springframework.dao.DataIntegrityViolationException: Could not execute JDBC batch update; nested exception is org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update</p> <p><span style="white-space: pre;"> </span>org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:636)</p> <p><span style="white-space: pre;"> </span>org.springframework.orm.hibernate3.HibernateTransactionManager.convertHibernateAccessException(HibernateTransactionManager.java:789)</p> <p><span style="white-space: pre;"> </span>org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:663)</p> <p><span style="white-space: pre;"> </span>org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:732)</p> <p><span style="white-space: pre;"> </span>org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:701)</p> <p><span style="white-space: pre;"> </span>org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:321)</p> <p><span style="white-space: pre;"> </span>org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:116)</p> <p><span style="white-space: pre;"> </span>org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)</p> <p><span style="white-space: pre;"> </span>org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)</p> <p><span style="white-space: pre;"> </span>org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)</p> <p><span style="white-space: pre;"> </span>org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)</p> <p><span style="white-space: pre;"> </span>$Proxy17.addhf(Unknown Source)</p> <p><span style="white-space: pre;"> </span>action.FileAction.add(FileAction.java:44)</p> <p><span style="white-space: pre;"> </span>sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)</p> <p><span style="white-space: pre;"> </span>sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)</p> <p><span style="white-space: pre;"> </span>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)</p> <p><span style="white-space: pre;"> </span>java.lang.reflect.Method.invoke(Method.java:597)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:441)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:280)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:243)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:165)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:252)</p> <p><span style="white-space: pre;"> </span>org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:122)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:179)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)</p> <p><span style="white-space: pre;"> </span>org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)</p> <p><span style="white-space: pre;"> </span>org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:94)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)</p> <p><span style="white-space: pre;"> </span>org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:235)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:89)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:130)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)</p> <p><span style="white-space: pre;"> </span>org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:267)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:126)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:138)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:165)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)</p> <p><span style="white-space: pre;"> </span>org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:179)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)</p> <p><span style="white-space: pre;"> </span>org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)</p> <p><span style="white-space: pre;"> </span>org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:488)</p> <p><span style="white-space: pre;"> </span>org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)</p> <p><span style="white-space: pre;"> </span>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)</p> <p>root cause</p> <p> </p> <p>org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update</p> <p><span style="white-space: pre;"> </span>org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:71)</p> <p><span style="white-space: pre;"> </span>org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)</p> <p><span style="white-space: pre;"> </span>org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:253)</p> <p><span style="white-space: pre;"> </span>org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:237)</p> <p><span style="white-space: pre;"> </span>org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:141)</p> <p><span style="white-space: pre;"> </span>org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)</p> <p><span style="white-space: pre;"> </span>org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)</p> <p><span style="white-space: pre;"> </span>org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)</p> <p><span style="white-space: pre;"> </span>org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)</p> <p><span style="white-space: pre;"> </span>org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)</p> <p><span style="white-space: pre;"> </span>org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:655)</p> <p><span style="white-space: pre;"> </span>org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:732)</p> <p><span style="white-space: pre;"> </span>org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:701)</p> <p><span style="white-space: pre;"> </span>org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:321)</p> <p><span style="white-space: pre;"> </span>org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:116)</p> <p><span style="white-space: pre;"> </span>org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)</p> <p><span style="white-space: pre;"> </span>org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)</p> <p><span style="white-space: pre;"> </span>org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)</p> <p><span style="white-space: pre;"> </span>org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)</p> <p><span style="white-space: pre;"> </span>$Proxy17.addhf(Unknown Source)</p> <p><span style="white-space: pre;"> </span>action.FileAction.add(FileAction.java:44)</p> <p><span style="white-space: pre;"> </span>sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)</p> <p><span style="white-space: pre;"> </span>sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)</p> <p><span style="white-space: pre;"> </span>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)</p> <p><span style="white-space: pre;"> </span>java.lang.reflect.Method.invoke(Method.java:597)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:441)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:280)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:243)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:165)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:252)</p> <p><span style="white-space: pre;"> </span>org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:122)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:179)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)</p> <p><span style="white-space: pre;"> </span>org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)</p> <p><span style="white-space: pre;"> </span>org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:94)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)</p> <p><span style="white-space: pre;"> </span>org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:235)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:89)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:130)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)</p> <p><span style="white-space: pre;"> </span>org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:267)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:126)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:138)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:165)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)</p> <p><span style="white-space: pre;"> </span>org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:179)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)</p> <p><span style="white-space: pre;"> </span>org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)</p> <p><span style="white-space: pre;"> </span>org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:488)</p> <p><span style="white-space: pre;"> </span>org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)</p> <p><span style="white-space: pre;"> </span>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)</p> <p>root cause</p> <p> </p> <p>java.sql.BatchUpdateException: ORA-02291: integrity constraint (HR.SYS_C005351) violated - parent key not found</p> <p> </p> <p><span style="white-space: pre;"> </span>oracle.jdbc.driver.DatabaseError.throwBatchUpdateException(DatabaseError.java:342)</p> <p><span style="white-space: pre;"> </span>oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:10656)</p> <p><span style="white-space: pre;"> </span>org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48)</p> <p><span style="white-space: pre;"> </span>org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:246)</p> <p><span style="white-space: pre;"> </span>org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:237)</p> <p><span style="white-space: pre;"> </span>org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:141)</p> <p><span style="white-space: pre;"> </span>org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)</p> <p><span style="white-space: pre;"> </span>org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)</p> <p><span style="white-space: pre;"> </span>org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)</p> <p><span style="white-space: pre;"> </span>org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)</p> <p><span style="white-space: pre;"> </span>org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)</p> <p><span style="white-space: pre;"> </span>org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:655)</p> <p><span style="white-space: pre;"> </span>org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:732)</p> <p><span style="white-space: pre;"> </span>org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:701)</p> <p><span style="white-space: pre;"> </span>org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:321)</p> <p><span style="white-space: pre;"> </span>org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:116)</p> <p><span style="white-space: pre;"> </span>org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)</p> <p><span style="white-space: pre;"> </span>org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)</p> <p><span style="white-space: pre;"> </span>org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)</p> <p><span style="white-space: pre;"> </span>org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)</p> <p><span style="white-space: pre;"> </span>$Proxy17.addhf(Unknown Source)</p> <p><span style="white-space: pre;"> </span>action.FileAction.add(FileAction.java:44)</p> <p><span style="white-space: pre;"> </span>sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)</p> <p><span style="white-space: pre;"> </span>sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)</p> <p><span style="white-space: pre;"> </span>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)</p> <p><span style="white-space: pre;"> </span>java.lang.reflect.Method.invoke(Method.java:597)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:441)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:280)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:243)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:165)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:252)</p> <p><span style="white-space: pre;"> </span>org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:122)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:179)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)</p> <p><span style="white-space: pre;"> </span>org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)</p> <p><span style="white-space: pre;"> </span>org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:94)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)</p> <p><span style="white-space: pre;"> </span>org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:235)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:89)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:130)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)</p> <p><span style="white-space: pre;"> </span>org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:267)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:126)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:138)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:165)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)</p> <p><span style="white-space: pre;"> </span>org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:179)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176)</p> <p><span style="white-space: pre;"> </span>com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)</p> <p><span style="white-space: pre;"> </span>org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)</p> <p><span style="white-space: pre;"> </span>org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:488)</p> <p><span style="white-space: pre;"> </span>org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)</p> <p><span style="white-space: pre;"> </span>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)</p> <p>note The full stack trace of the root cause is available in the Apache Tomcat/6.0.13 logs.</p> <p> </p> <p>Apache Tomcat/6.0.13</p>

hibernate 的join fetch问题。。

比如我有个员工类User,1个地址类Address [code="java"] public class User{ int id; Address add; } public class Address{ int id; int userId; } [/code] mapping中2者没有任何关联 我想问下能不能不配置mapping关系,直接用hql通过user的id查询user时把address同时查出来 这个是我自己写的个hql [code="java"] from User as user left join fetch user.acc as acc on user.id=acc.userId where user.id=1"; [/code] 不过有错误。。。希望哪位能指点下小弟

Hibernate跳錯 org.hibernate.hql.internal.ast.QuerySyntaxException

1问题 我准备写一个spring mvc搭hibernate的框架 <br> spring 版本4.3.2 hibernate 5.0.1 <br> 我想连到我写指定的位置 /review 却出现问题 <br> 测试的时候,有成功建立表格在资料库,但我要连到我要的JSP网页时 <br> hibernate却跳错<br> 看起来很高的机率是daoimpl 或是model出问题,但是我看不出来,<br> 希望有好心人士可以跟小弟指点,谢谢 <br> 2.代码 [github](https://github.com/makers95/EEITProject "") 3.报错 ``` Type Exception Report Message Request processing failed; nested exception is java.lang.IllegalArgumentException: org.hibernate.hql.internal.ast.QuerySyntaxException: review is not mapped [FROM review] Description The server encountered an unexpected condition that prevented it from fulfilling the request. Exception org.springframework.web.util.NestedServletException: Request processing failed; nested exception is java.lang.IllegalArgumentException: org.hibernate.hql.internal.ast.QuerySyntaxException: review is not mapped [FROM review] org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:982) org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861) javax.servlet.http.HttpServlet.service(HttpServlet.java:634) org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846) javax.servlet.http.HttpServlet.service(HttpServlet.java:741) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) Root Cause java.lang.IllegalArgumentException: org.hibernate.hql.internal.ast.QuerySyntaxException: review is not mapped [FROM review] org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:133) org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:157) org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:164) org.hibernate.internal.AbstractSharedSessionContract.createQuery(AbstractSharedSessionContract.java:670) org.hibernate.internal.AbstractSharedSessionContract.createQuery(AbstractSharedSessionContract.java:103) review.daoimpl.ReviewDaoImpl.getAllReview(ReviewDaoImpl.java:26) review.serviceimpl.ReviewServiceImpl.getAllReviews(ReviewServiceImpl.java:21) java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) java.base/java.lang.reflect.Method.invoke(Method.java:566) org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:333) org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190) org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99) org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:282) org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96) org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213) com.sun.proxy.$Proxy48.getAllReviews(Unknown Source) review.controller.reviewController.welcome(reviewController.java:20) java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) java.base/java.lang.reflect.Method.invoke(Method.java:566) org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205) org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:133) org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:97) org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:849) org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:760) org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85) org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:967) org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:901) org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970) org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861) javax.servlet.http.HttpServlet.service(HttpServlet.java:634) org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846) javax.servlet.http.HttpServlet.service(HttpServlet.java:741) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) Root Cause org.hibernate.hql.internal.ast.QuerySyntaxException: review is not mapped [FROM review] org.hibernate.hql.internal.ast.QuerySyntaxException.generateQueryException(QuerySyntaxException.java:79) org.hibernate.QueryException.wrapWithQueryString(QueryException.java:103) org.hibernate.hql.internal.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:217) org.hibernate.hql.internal.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:141) org.hibernate.engine.query.spi.HQLQueryPlan.<init>(HQLQueryPlan.java:115) org.hibernate.engine.query.spi.HQLQueryPlan.<init>(HQLQueryPlan.java:77) org.hibernate.engine.query.spi.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:153) org.hibernate.internal.AbstractSharedSessionContract.getQueryPlan(AbstractSharedSessionContract.java:553) org.hibernate.internal.AbstractSharedSessionContract.createQuery(AbstractSharedSessionContract.java:662) org.hibernate.internal.AbstractSharedSessionContract.createQuery(AbstractSharedSessionContract.java:103) review.daoimpl.ReviewDaoImpl.getAllReview(ReviewDaoImpl.java:26) review.serviceimpl.ReviewServiceImpl.getAllReviews(ReviewServiceImpl.java:21) java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) java.base/java.lang.reflect.Method.invoke(Method.java:566) org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:333) org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190) org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99) org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:282) org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96) org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213) com.sun.proxy.$Proxy48.getAllReviews(Unknown Source) review.controller.reviewController.welcome(reviewController.java:20) java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) java.base/java.lang.reflect.Method.invoke(Method.java:566) org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205) org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:133) org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:97) org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:849) org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:760) org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85) org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:967) org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:901) org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970) org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861) javax.servlet.http.HttpServlet.service(HttpServlet.java:634) org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846) javax.servlet.http.HttpServlet.service(HttpServlet.java:741) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) Root Cause org.hibernate.hql.internal.ast.QuerySyntaxException: review is not mapped org.hibernate.hql.internal.ast.util.SessionFactoryHelper.requireClassPersister(SessionFactoryHelper.java:169) org.hibernate.hql.internal.ast.tree.FromElementFactory.addFromElement(FromElementFactory.java:91) org.hibernate.hql.internal.ast.tree.FromClause.addFromElement(FromClause.java:79) org.hibernate.hql.internal.ast.HqlSqlWalker.createFromElement(HqlSqlWalker.java:326) org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.fromElement(HqlSqlBaseWalker.java:3706) org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.fromElementList(HqlSqlBaseWalker.java:3595) org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.fromClause(HqlSqlBaseWalker.java:720) org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:576) org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:313) org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:261) org.hibernate.hql.internal.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:266) org.hibernate.hql.internal.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:189) org.hibernate.hql.internal.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:141) org.hibernate.engine.query.spi.HQLQueryPlan.<init>(HQLQueryPlan.java:115) org.hibernate.engine.query.spi.HQLQueryPlan.<init>(HQLQueryPlan.java:77) org.hibernate.engine.query.spi.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:153) org.hibernate.internal.AbstractSharedSessionContract.getQueryPlan(AbstractSharedSessionContract.java:553) org.hibernate.internal.AbstractSharedSessionContract.createQuery(AbstractSharedSessionContract.java:662) org.hibernate.internal.AbstractSharedSessionContract.createQuery(AbstractSharedSessionContract.java:103) review.daoimpl.ReviewDaoImpl.getAllReview(ReviewDaoImpl.java:26) review.serviceimpl.ReviewServiceImpl.getAllReviews(ReviewServiceImpl.java:21) java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) java.base/java.lang.reflect.Method.invoke(Method.java:566) org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:333) org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190) org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99) org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:282) org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96) org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213) com.sun.proxy.$Proxy48.getAllReviews(Unknown Source) review.controller.reviewController.welcome(reviewController.java:20) java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) java.base/java.lang.reflect.Method.invoke(Method.java:566) org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205) org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:133) org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:97) org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:849) org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:760) org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85) org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:967) org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:901) org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970) org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861) javax.servlet.http.HttpServlet.service(HttpServlet.java:634) org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846) javax.servlet.http.HttpServlet.service(HttpServlet.java:741) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) Note The full stack trace of the root cause is available in the server logs. ``` 4.尝试 我有找了几篇 <br> [stackoverflow](https://stackoverflow.com/questions/14446048/hibernate-table-not-mapped-error-in-hql-query "") 映射关系可能写错 但看起来都不是 看了几乎一整天,还没有解决

hql查询报错。。。。实体类问题

hql语句: String hql="from CouponPublishEntity e inner join e.couponpool c where c.owner='"+userId+"' and e.pubid in ("+ids+") "; 报错 [org.jeecgframework.core.common.exception.GlobalExceptionResolver]全局处理异常捕获: org.hibernate.QueryException: could not resolve property: couponpool of: com.sendiy.hh.coupons.entity.CouponPublishEntity [from com.sendiy.hh.coupons.entity.CouponPublishEntity e inner join e.couponpool c where c.owner='4028668150c6aedb0150c6ddde750005' and e.pubid in ('2') ] 问题是实体类写错了吗,还是语法错了·

初级玩转Linux+Ubuntu(嵌入式开发基础课程)

课程主要面向嵌入式Linux初学者、工程师、学生 主要从一下几方面进行讲解: 1.linux学习路线、基本命令、高级命令 2.shell、vi及vim入门讲解 3.软件安装下载、NFS、Samba、FTP等服务器配置及使用

我以为我对Mysql事务很熟,直到我遇到了阿里面试官

太惨了,面试又被吊打

Python代码实现飞机大战

文章目录经典飞机大战一.游戏设定二.我方飞机三.敌方飞机四.发射子弹五.发放补给包六.主模块 经典飞机大战 源代码以及素材资料(图片,音频)可从下面的github中下载: 飞机大战源代码以及素材资料github项目地址链接 ————————————————————————————————————————————————————————— 不知道大家有没有打过飞机,喜不喜欢打飞机。当我第一次接触这个东西的时候,我的内心是被震撼到的。第一次接触打飞机的时候作者本人是身心愉悦的,因为周边的朋友都在打飞机, 每

Python数据分析与挖掘

92讲视频课+16大项目实战+源码+¥800元课程礼包+讲师社群1V1答疑+社群闭门分享会=99元 &nbsp; 为什么学习数据分析? &nbsp; &nbsp; &nbsp; 人工智能、大数据时代有什么技能是可以运用在各种行业的?数据分析就是。 &nbsp; &nbsp; &nbsp; 从海量数据中获得别人看不见的信息,创业者可以通过数据分析来优化产品,营销人员可以通过数据分析改进营销策略,产品经理可以通过数据分析洞察用户习惯,金融从业者可以通过数据分析规避投资风险,程序员可以通过数据分析进一步挖掘出数据价值,它和编程一样,本质上也是一个工具,通过数据来对现实事物进行分析和识别的能力。不管你从事什么行业,掌握了数据分析能力,往往在其岗位上更有竞争力。 &nbsp;&nbsp; 本课程共包含五大模块: 一、先导篇: 通过分析数据分析师的一天,让学员了解全面了解成为一个数据分析师的所有必修功法,对数据分析师不在迷惑。 &nbsp; 二、基础篇: 围绕Python基础语法介绍、数据预处理、数据可视化以及数据分析与挖掘......这些核心技能模块展开,帮助你快速而全面的掌握和了解成为一个数据分析师的所有必修功法。 &nbsp; 三、数据采集篇: 通过网络爬虫实战解决数据分析的必经之路:数据从何来的问题,讲解常见的爬虫套路并利用三大实战帮助学员扎实数据采集能力,避免没有数据可分析的尴尬。 &nbsp; 四、分析工具篇: 讲解数据分析避不开的科学计算库Numpy、数据分析工具Pandas及常见可视化工具Matplotlib。 &nbsp; 五、算法篇: 算法是数据分析的精华,课程精选10大算法,包括分类、聚类、预测3大类型,每个算法都从原理和案例两个角度学习,让你不仅能用起来,了解原理,还能知道为什么这么做。

如何在虚拟机VM上使用串口

在系统内核开发中,经常会用到串口调试,利用VMware的Virtual Machine更是为调试系统内核如虎添翼。那么怎么搭建串口调试环境呢?因为最近工作涉及到这方面,利用强大的google搜索和自己

程序员的兼职技能课

获取讲师答疑方式: 在付费视频第一节(触摸命令_ALL)片头有二维码及加群流程介绍 限时福利 原价99元,今日仅需39元!购课添加小助手(微信号:csdn590)按提示还可领取价值800元的编程大礼包! 讲师介绍: 苏奕嘉&nbsp;前阿里UC项目工程师 脚本开发平台官方认证满级(六级)开发者。 我将如何教会你通过【定制脚本】赚到你人生的第一桶金? 零基础程序定制脚本开发课程,是完全针对零脚本开发经验的小白而设计,课程内容共分为3大阶段: ①前期将带你掌握Q开发语言和界面交互开发能力; ②中期通过实战来制作有具体需求的定制脚本; ③后期将解锁脚本的更高阶玩法,打通任督二脉; ④应用定制脚本合法赚取额外收入的完整经验分享,带你通过程序定制脚本开发这项副业,赚取到你的第一桶金!

MFC一站式终极全套课程包

该套餐共包含从C小白到C++到MFC的全部课程,整套学下来绝对成为一名C++大牛!!!

C++语言基础视频教程

C++语言基础视频培训课程:本课与主讲者在大学开出的程序设计课程直接对接,准确把握知识点,注重教学视频与实践体系的结合,帮助初学者有效学习。本教程详细介绍C++语言中的封装、数据隐藏、继承、多态的实现等入门知识;主要包括类的声明、对象定义、构造函数和析构函数、运算符重载、继承和派生、多态性实现等。 课程需要有C语言程序设计的基础(可以利用本人开出的《C语言与程序设计》系列课学习)。学习者能够通过实践的方式,学会利用C++语言解决问题,具备进一步学习利用C++开发应用程序的基础。

北京师范大学信息科学与技术学院笔试10复试真题

北京师范大学信息科学与技术学院笔试,可以更好的让你了解北师大该学院的复试内容,获得更好的成绩。

深度学习原理+项目实战+算法详解+主流框架(套餐)

深度学习系列课程从深度学习基础知识点开始讲解一步步进入神经网络的世界再到卷积和递归神经网络,详解各大经典网络架构。实战部分选择当下最火爆深度学习框架PyTorch与Tensorflow/Keras,全程实战演示框架核心使用与建模方法。项目实战部分选择计算机视觉与自然语言处理领域经典项目,从零开始详解算法原理,debug模式逐行代码解读。适合准备就业和转行的同学们加入学习! 建议按照下列课程顺序来进行学习 (1)掌握深度学习必备经典网络架构 (2)深度框架实战方法 (3)计算机视觉与自然语言处理项目实战。(按照课程排列顺序即可)

网络工程师小白入门--【思科CCNA、华为HCNA等网络工程师认证】

本课程适合CCNA或HCNA网络小白同志,高手请绕道,可以直接学习进价课程。通过本预科课程的学习,为学习网络工程师、思科CCNA、华为HCNA这些认证打下坚实的基础! 重要!思科认证2020年2月24日起,已启用新版认证和考试,包括题库都会更新,由于疫情原因,请关注官网和本地考点信息。题库网络上很容易下载到。

Python界面版学生管理系统

前不久上传了一个控制台版本的学生管理系统,这个是Python界面版学生管理系统,这个是使用pycharm开发的一个有界面的学生管理系统,基本的增删改查,里面又演示视频和完整代码,有需要的伙伴可以自行下

软件测试2小时入门

本课程内容系统、全面、简洁、通俗易懂,通过2个多小时的介绍,让大家对软件测试有个系统的理解和认识,具备基本的软件测试理论基础。 主要内容分为5个部分: 1 软件测试概述,了解测试是什么、测试的对象、原则、流程、方法、模型;&nbsp; 2.常用的黑盒测试用例设计方法及示例演示;&nbsp; 3 常用白盒测试用例设计方法及示例演示;&nbsp; 4.自动化测试优缺点、使用范围及示例‘;&nbsp; 5.测试经验谈。

Tomcat服务器下载、安装、配置环境变量教程(超详细)

未经我的允许,请不要转载我的文章,在此郑重声明!!! 请先配置安装好Java的环境,若没有安装,请参照我博客上的步骤进行安装! 安装Java环境教程https://blog.csdn.net/qq_40881680/article/details/83585542 Tomcat部署Web项目(一)·内嵌https://blog.csdn.net/qq_40881680/article/d...

2019数学建模A题高压油管的压力控制 省一论文即代码

2019数学建模A题高压油管的压力控制省一完整论文即详细C++和Matlab代码,希望对同学们有所帮助

图书管理系统(Java + Mysql)我的第一个完全自己做的实训项目

图书管理系统 Java + MySQL 完整实训代码,MVC三层架构组织,包含所有用到的图片资源以及数据库文件,大三上学期实训,注释很详细,按照阿里巴巴Java编程规范编写

linux下利用/proc进行进程树的打印

在linux下利用c语言实现的进程树的打印,主要通过/proc下的目录中的进程文件,获取status中的进程信息内容,然后利用递归实现进程树的打印

微信小程序开发实战之番茄时钟开发

微信小程序番茄时钟视频教程,本课程将带着各位学员开发一个小程序初级实战类项目,针对只看过官方文档而又无从下手的开发者来说,可以作为一个较好的练手项目,对于有小程序开发经验的开发者而言,可以更好加深对小程序各类组件和API 的理解,为更深层次高难度的项目做铺垫。

[已解决]踩过的坑之mysql连接报“Communications link failure”错误

目录 前言 第一种方法: 第二种方法 第三种方法(适用于项目和数据库在同一台服务器) 第四种方法 第五种方法(项目和数据库不在同一台服务器) 总结 前言 先给大家简述一下我的坑吧,(我用的是mysql,至于oracle有没有这样的问题,有心的小伙伴们可以测试一下哈), 在自己做个javaweb测试项目的时候,因为买的是云服务器,所以数据库连接的是用ip地址,用IDE开发好...

人工智能-计算机视觉实战之路(必备算法+深度学习+项目实战)

系列课程主要分为3大阶段:(1)首先掌握计算机视觉必备算法原理,结合Opencv进行学习与练手,通过实际视项目进行案例应用展示。(2)进军当下最火的深度学习进行视觉任务实战,掌握深度学习中必备算法原理与网络模型架构。(3)结合经典深度学习框架与实战项目进行实战,基于真实数据集展开业务分析与建模实战。整体风格通俗易懂,项目驱动学习与就业面试。 建议同学们按照下列顺序来进行学习:1.Python入门视频课程 2.Opencv计算机视觉实战(Python版) 3.深度学习框架-PyTorch实战/人工智能框架实战精讲:Keras项目 4.Python-深度学习-物体检测实战 5.后续实战课程按照自己喜好选择就可以

2019 AI开发者大会

2019 AI开发者大会(AI ProCon 2019)是由中国IT社区CSDN主办的AI技术与产业年度盛会。多年经验淬炼,如今蓄势待发:2019年9月6-7日,大会将有近百位中美顶尖AI专家、知名企业代表以及千余名AI开发者齐聚北京,进行技术解读和产业论证。我们不空谈口号,只谈技术,诚挚邀请AI业内人士一起共铸人工智能新篇章!

机器学习初学者必会的案例精讲

通过六个实际的编码项目,带领同学入门人工智能。这些项目涉及机器学习(回归,分类,聚类),深度学习(神经网络),底层数学算法,Weka数据挖掘,利用Git开源项目实战等。

Python数据分析师-实战系列

系列课程主要包括Python数据分析必备工具包,数据分析案例实战,核心算法实战与企业级数据分析与建模解决方案实战,建议大家按照系列课程阶段顺序进行学习。所有数据集均为企业收集的真实数据集,整体风格以实战为导向,通俗讲解Python数据分析核心技巧与实战解决方案。

YOLOv3目标检测实战系列课程

《YOLOv3目标检测实战系列课程》旨在帮助大家掌握YOLOv3目标检测的训练、原理、源码与网络模型改进方法。 本课程的YOLOv3使用原作darknet(c语言编写),在Ubuntu系统上做项目演示。 本系列课程包括三门课: (1)《YOLOv3目标检测实战:训练自己的数据集》 包括:安装darknet、给自己的数据集打标签、整理自己的数据集、修改配置文件、训练自己的数据集、测试训练出的网络模型、性能统计(mAP计算和画出PR曲线)和先验框聚类。 (2)《YOLOv3目标检测:原理与源码解析》讲解YOLOv1、YOLOv2、YOLOv3的原理、程序流程并解析各层的源码。 (3)《YOLOv3目标检测:网络模型改进方法》讲解YOLOv3的改进方法,包括改进1:不显示指定类别目标的方法 (增加功能) ;改进2:合并BN层到卷积层 (加快推理速度) ; 改进3:使用GIoU指标和损失函数 (提高检测精度) ;改进4:tiny YOLOv3 (简化网络模型)并介绍 AlexeyAB/darknet项目。

2021考研数学张宇基础30讲.pdf

张宇:博士,全国著名考研数学辅导专家,教育部“国家精品课程建设骨干教师”,全国畅销书《张宇高等数学18讲》《张宇线性代数9讲》《张宇概率论与数理统计9讲》《张宇考研数学题源探析经典1000题》《张宇考

三个项目玩转深度学习(附1G源码)

从事大数据与人工智能开发与实践约十年,钱老师亲自见证了大数据行业的发展与人工智能的从冷到热。事实证明,计算机技术的发展,算力突破,海量数据,机器人技术等,开启了第四次工业革命的序章。深度学习图像分类一直是人工智能的经典任务,是智慧零售、安防、无人驾驶等机器视觉应用领域的核心技术之一,掌握图像分类技术是机器视觉学习的重中之重。针对现有线上学习的特点与实际需求,我们开发了人工智能案例实战系列课程。打造:以项目案例实践为驱动的课程学习方式,覆盖了智能零售,智慧交通等常见领域,通过基础学习、项目案例实践、社群答疑,三维立体的方式,打造最好的学习效果。

DirectX修复工具V4.0增强版

DirectX修复工具(DirectX Repair)是一款系统级工具软件,简便易用。本程序为绿色版,无需安装,可直接运行。 本程序的主要功能是检测当前系统的DirectX状态,如果发现异常则进行修复

期末考试评分标准的数学模型

大学期末考试与高中的考试存在很大的不同之处,大学的期末考试成绩是主要分为两个部分:平时成绩和期末考试成绩。平时成绩和期末考试成绩总分一般为一百分,然而平时成绩与期末考试成绩所占的比例不同会导致出现不同

Vue.js 2.0之全家桶系列视频课程

基于新的Vue.js 2.3版本, 目前新全的Vue.js教学视频,让你少走弯路,直达技术前沿! 1. 包含Vue.js全家桶(vue.js、vue-router、axios、vuex、vue-cli、webpack、ElementUI等) 2. 采用笔记+代码案例的形式讲解,通俗易懂

c语言项目开发实例

十个c语言案例 (1)贪吃蛇 (2)五子棋游戏 (3)电话薄管理系统 (4)计算器 (5)万年历 (6)电子表 (7)客户端和服务器通信 (8)潜艇大战游戏 (9)鼠标器程序 (10)手机通讯录系统

相关热词 c#中如何设置提交按钮 c#帮助怎么用 c# 读取合并单元格的值 c#带阻程序 c# 替换span内容 c# rpc c#控制台点阵字输出 c#do while循环 c#调用dll多线程 c#找出两个集合不同的
立即提问