org.hibernate.QueryException: could not resolve property: qxid of: org.zero.space.entity.TblJd [select fwxx.fwid , fwxx.tblUser ,fwxx.title , fwxx.zj ,fwxx.date from org.zero.space.entity.TblFwxx fwxx, org.zero.space.entity.TblJd jd where fwxx.tblJd = jd.jdid and fwxx.title like '%null%'and fwxx.shi = 'null' and fwxx.ting = 'null'and jd.qxid = 'null']

解决方案 »

  1.   

    org.hibernate.exception.SQLGrammarException: could not execute query
      

  2.   

    你的数据库时通过hibernate配置文件反转得到的还是自己建的啊????????????
      

  3.   

    数据库是直接建的 持久化类和*.hbm.xml 是通过Hibernate inverse engineering 得到的
      

  4.   

    在一个类中测试 
    public static void main(String [] args) {
    Configuration config = new Configuration().configure();
    SessionFactory factory = config.buildSessionFactory();
    Session session = factory.openSession();
    String hql = "select fwxx.fwid , fwxx.tblUser.uid ,fwxx.title , fwxx.zj ," +
    "fwxx.date from TblFwxx fwxx, TblJd jd where 1=1 ";
    List list = session.createQuery(hql).list();
    Iterator iterator = list.iterator();
    while(iterator.hasNext()){
    Object [] object = (Object[])iterator.next();
    System.out.println(object[0]+"  "+object[1]+"  "+object[2]+" "+object[3]+" "+object[4] );
    }
    }总是报这个错误
    Exception in thread "main" org.hibernate.PropertyNotFoundException: Could not find a getter for jdid in class org.zero.space.entity.TblFwxx
    at org.hibernate.property.BasicPropertyAccessor.createGetter(BasicPropertyAccessor.java:282)
    at org.hibernate.property.BasicPropertyAccessor.getGetter(BasicPropertyAccessor.java:275)
    at org.hibernate.mapping.Property.getGetter(Property.java:260)
    at org.hibernate.tuple.PojoEntityTuplizer.buildPropertyGetter(PojoEntityTuplizer.java:255)
    at org.hibernate.tuple.AbstractEntityTuplizer.<init>(AbstractEntityTuplizer.java:121)
    at org.hibernate.tuple.PojoEntityTuplizer.<init>(PojoEntityTuplizer.java:55)
    at org.hibernate.tuple.TuplizerLookup.create(TuplizerLookup.java:64)
    at org.hibernate.tuple.EntityMetamodel.<init>(EntityMetamodel.java:257)
    at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:412)
    at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:108)
    at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55)
    at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:216)
    at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1176)
    at test.Test.main(Test.java:14)