could not resolve property: leader_id of: pojo.Project

https://www.cnblogs.com/zhaocundang/p/9211270.html

hibernate 双向1对多 出现问题
外键解析错误!

log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment).
log4j:WARN Please initialize the log4j system properly.
1
Exception in thread "main" org.hibernate.QueryException: could not resolve property: leader_id of: pojo.Project
    at org.hibernate.persister.entity.AbstractPropertyMapping.propertyException(AbstractPropertyMapping.java:67)
    at org.hibernate.persister.entity.AbstractPropertyMapping.toType(AbstractPropertyMapping.java:61)
    at org.hibernate.persister.entity.AbstractEntityPersister.getSubclassPropertyTableNumber(AbstractEntityPersister.java:1392)
    at org.hibernate.persister.entity.BasicEntityPropertyMapping.toColumns(BasicEntityPropertyMapping.java:54)
    at org.hibernate.persister.entity.AbstractEntityPersister.toColumns(AbstractEntityPersister.java:1367)
    at org.hibernate.loader.criteria.CriteriaQueryTranslator.getColumns(CriteriaQueryTranslator.java:457)
    at org.hibernate.loader.criteria.CriteriaQueryTranslator.getColumnsUsingProjection(CriteriaQueryTranslator.java:417)
    at org.hibernate.criterion.SimpleExpression.toSqlString(SimpleExpression.java:68)
    at org.hibernate.loader.criteria.CriteriaQueryTranslator.getWhereCondition(CriteriaQueryTranslator.java:357)
    at org.hibernate.loader.criteria.CriteriaJoinWalker.<init>(CriteriaJoinWalker.java:113)
    at org.hibernate.loader.criteria.CriteriaJoinWalker.<init>(CriteriaJoinWalker.java:82)
    at org.hibernate.loader.criteria.CriteriaLoader.<init>(CriteriaLoader.java:91)
    at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1578)
    at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:306)
    at test.test.main(test.java:55)
![](https://images2018.cnblogs.com/blog/782772/201806/782772-20180621223815454-2140020358.png)

![](https://images2018.cnblogs.com/blog/782772/201806/782772-20180621223823178-1379449211.png)


改为

成功:

原文地址:https://www.cnblogs.com/zhaocundang/p/9211270.html

时间: 2024-10-14 19:58:48

could not resolve property: leader_id of: pojo.Project的相关文章

could not resolve property: name of:

spring date jpa 错误:could not resolve property: name of: 在写 查询的时候,把实体类的属性写错了,即 sql 语句中字段与实体类中属性没有对应,造成无法解析. @Query("from Product p where p.id.productName like :name") List<Product> getInfoByName(@Param("name")String name,Pageable

could not resolve property

could not resolve property:出现此错误我们在Wdzlog.hbm.xml文件下加上<property name="name" column="name"/>便可

many to one could not resolve property

今天在做一个功能的时候 遇到了.一个Could not resolve property 的问题. 配置文件如下: Java代码   <many-to-one name="user"  class="Users" column="StudentExam_user_fid" cascade="all" ></many-to-one> 查询代码: Java代码   Criteria crt = sessio

数据库异常整理:org.hibernate.QueryException: could not resolve property: “mStation”

最近用hibernate作数据库查询,结果遇到问题: org.hibernate.QueryException: could not resolve property: 'mStation'of  经过各个步骤检查,还是没找到方法. 在此,整理一下这个问题的导致可能原因: 一.排查HQL语句中的类字段,看是否是java类中的字段,不要是数据库中的字段: 二.排查各个字段是否与类中字段一致,绝大多数可能是由于字段不匹配导致的问题: 三.如果以上两部都检查没有问题,那么很可能就是JavaBean命名

org.hibernate.QueryException: could not resolve property:

项目一直报这个错误,网上也搜了很多相关的,有的说 hql 查询语句和 实体类没有对应起来,可是我的都对应了,还是不知道问题在哪.上代码 public List<Survey> findMySurveys(User user) { String hql = "from Survey s join s.user u where u.id = ?" ; List<Survey> list = surveyDao.findEntityByHql(hql, user.ge

Gradle自定义property

?Gradle自定义property 设置和读取Project的Property是使用Gradle的一个很重要的方面.比如,很多Plugin都会向Project中加入额外的Property. 在使用这些Plugin时,我们需要对这些Property进行赋值. Gradle在默认情况下已经为Project定义了很多Property,其中比较常用的有: project:Project本身 name:Project的名字 path:Project的绝对路径 description:Project的描述

【JAVA错误笔记】 - Unable add facets project AnnotationWebService CXF 2-x Web Services

错误描述: 创建webservice接口服务时候提示: Unable add facets project AnnotationWebService CXF 2-x Web Services Unable to add the follwing facets to project AnnotationWebService: CXF 2.x Web Services. If you are getting below exception while creating annotation base

Android 混淆文件project.properties和proguard-project.txt

参考文档:http://blog.csdn.net/xueyepiaoling/article/details/8202359 http://glblong.blog.51cto.com/3058613/1263969 在新版本的ADT创建项目时,混码的文件不再是proguard.cfg,而是project.properties和proguard-project.txt. 如果需要对项目进行全局混码,只需要进行一步操作: 将project.properties的中 “#  proguard.co

Hibernate常见错误整理

Hibernate常见错误合集 1.错误:object references an unsaved transient instance - save the transient instance before flushing: com.xxxx.bean.java.Sysblog; nested exception is org.hibernate.TransientObjectException: object references an unsaved transient instanc