org.hibernate.hql.ast.QuerySyntaxException求高人指教

helen_pk2022-10-04 11:39:541条回答

org.hibernate.hql.ast.QuerySyntaxException求高人指教
我执行了一条SQL
select po from com.forgon.cs.onlinepreparation.question.model.Question as po where difficultyValue = '' and typeForDisplay = '' order by dbms_random.value
然后hibernate内就抛出了异常
org.hibernate.hql.ast.QuerySyntaxException: Invalid path: 'dbms_random.value' [
应该是hibernate把dbms_random.value当成了这个表的属性所以报错,不知道有没人知道怎样做可以不用去遍历resultset而直接得到绑定到对象里的结果

已提交,审核后显示!提交回复

共1条回复
风吹JJ毛不乱 共回答了16个问题 | 采纳率81.3%
既然你用的是HQL查询的话,那就不能用ORACLE的函数“ dbms_random.value”进行随机排序啊;个人觉得,你要实现随机排序的功能的话,不如就换成SQL查询,感觉还要方便些;
1年前

相关推荐

org.hibernate.hql.ast.QuerySyntaxException: unexpected token
org.hibernate.hql.ast.QuerySyntaxException: unexpected token: * near line 1, column 8
* near line 1, column 8 [select * from (select t.*, rownum rn from edu.rjxy.entity.Task t) where rn>=(?-1)*?+1 and rn
星海知心1年前1
衣衫褴褛黄发男孩 共回答了19个问题 | 采纳率89.5%
你的HQL语句错了,检查一下 HQL语句 ,如果测试可以 打印出sql语句测试 在hibernate中加入参数 show_sql 值为 true
请求英文高手could not open hibernate Session for transaction :nest
请求英文高手
could not open hibernate Session for transaction :nested exception is org.hibernate.exception.GenericJDBCException:Cannot open connection
麻烦英文高手翻译下
牵我手好吗1年前2
雪虫虫 共回答了26个问题 | 采纳率88.5%
无法打开,冬眠期交易:嵌套例外是org.hibernate.exception.genericjdbcexception :不能打开连接
高分求教……org.hibernate.hql.ast.QuerySyntaxException:User is not
高分求教……org.hibernate.hql.ast.QuerySyntaxException:User is not mapped [from User]
org.springframework.orm.hibernate3.HibernateQueryException:User is not mapped [from User]; nested exception is org.hibernate.hql.ast.QuerySyntaxException:User is not mapped [from User]
org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:657)
org.springframework.orm.hibernate3.HibernateTemplate.find(HibernateTemplate.java:921)
org.springframework.orm.hibernate3.HibernateTemplate.find(HibernateTemplate.java:913)
com.test.model.UserAction.execute(UserAction.java:54)
……
beans.xml中是:
com.test.model
hibernate.dialect=org.hibernate.dialect.SQLServerDialect
hibernate.show_sql=true
hibernate.hbm2ddl.auto=update
struts.xml如下:
/success.jsp
/fail.jsp
……
.class类如下:
public String execute() throws Exception {
if(password.equals(password2)){
User user = new User();
user.setUsername(username);
user.setPassword(password);
hibernateTemplate.save(user);
return hibernateTemplate.find("from User").size()>0?"success":"fail";
}
return "fail";
}
不是我想写那么多,实在是没有办法了,第一次用struts2hibernatespring整合后出现的这个问题,我一整天了都没得解决,hibernateTemplate.save()可以,但hibernateTemplate.find()就不得了,把我的分拿去吧
hfye1年前1
那一季的飞扬 共回答了22个问题 | 采纳率90.9%


com.test.model




hibernate.dialect=org.hibernate.dialect.SQLServerDialect
hibernate.show_sql=true
hibernate.hbm2ddl.auto=update

hibernate问题//此处class报错,The content of element type "class" m
hibernate问题
//此处class报错,The content of element type "class" must match(知道原因,求具体改法)

"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

package="org.hibernate.test.sql"
default-access="field">
//此处class报错,The content of element type "class" must match(知道原因,求具体改法)




inverse="true"
order-by="DUMMY">




query-ref="organizationCurrentEmployments"/>

INSERT INTO ORGANIZATION (NAME, ORGID) VALUES ( UPPER(?), ? )
UPDATE ORGANIZATION SET NAME=UPPER(?) WHERE ORGID=?
DELETE FROM ORGANIZATION WHERE ORGID=?

coolpq1年前1
dailiu626 共回答了26个问题 | 采纳率84.6%
class与对应的表要对应 如:
org.hibernate.exception.SQLGrammarException:could not execut
org.hibernate.exception.SQLGrammarException:could not execute query求高手拯救,
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:92) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66) at org.hibernate.loader.Loader.doList(Loader.java:2536) at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2276) at org.hibernate.loader.Loader.list(Loader.java:2271) at org.hibernate.loader.custom.CustomLoader.
c_w_oq385m_p087c1年前1
niuniu7375 共回答了19个问题 | 采纳率94.7%
你会不会是在这个customer类里定义了变量是其他类的外键,然后在其他类里和这个类里的这个变量类型不一样啊!?
问SAT语法指代问题1.指代Almost all animals that hibernate prepare for
问SAT语法指代问题
1.指代
Almost all animals that hibernate prepare for hibernation during summer by eating large amounts of food,which they convert to thick layers of fat.
这句话语法上面是对的,但请问they的指代清楚么?如果按句意理解they指代animals,但为什么不能指代eating large amounts of food的呢?
求教语法达人
Jessica52531年前1
samkun 共回答了22个问题 | 采纳率90.9%
which 引导的是定语从句,修饰 amounts of food.如果正常语序的话 应该是 they(animals) convert which( amounts of food) to thick layer of fat.
some warm-blooded animals ( )hibernate.
some warm-blooded animals ( )hibernate.
1.need not
2.does not need
3.not need
4.do not need
1-11
柔柔猫猫1年前4
hktklg 共回答了26个问题 | 采纳率84.6%
选A,need在否定句和疑问句是情态动词,后直接加not再加动词原形,所以是need not.在肯定句中是实义动词,要借助助动词do的各种形式来变否定,结合本题应是do not再加动词原形.
Some animals hibernate under snow,because there is much air
Some animals hibernate under snow,because there is much air in loose snow
省府里的哨兵1年前1
olzolzolz3 共回答了19个问题 | 采纳率84.2%
有些动物在雪下面冬眠,因为松松的雪里面有许多空气.
unitils有几个包,其中有个数据库连接包,会与hibernate3冲突,
unitils有几个包,其中有个数据库连接包,会与hibernate3冲突,
我已经解决了,我的项目管理工具是maven.
依赖导入了很多unitils的包,像dbutil,像database...;其中database下面有个hibernate-ga-的包(包名不一定完全一致,我只是凭记忆打出来的),这个包和hibernate3冲突了.导致部署不到tomcat下面,这时候用排除依赖.
本来是
org.unitils
unitils-database
3.3
改成
org.unitils
unitils-database
3.3
hibernate
org.hibernate
然后把lib清空一下,clean 之后再编译生成一下就好了.
BOBO_小晨1年前1
**kangyi 共回答了14个问题 | 采纳率92.9%
一般用ssh集合时,删除antlr-2.7.2,asm-2.2.1
1.在Hibernate中,以下关于主键生成器说法错误的是( )。
1.在Hibernate中,以下关于主键生成器说法错误的是( )。
A.increment可以用于类型为long、short或byte的主键
B.identity用于如SQL Server、DB2、MySQL等支持标识列的数据库
C.sequence用于如Oracle、SQL Server等支持序列的数据库
D.native由Hibernate根据底层数据库自行判断采用何种主键生成策略,是由使用的数据库生成主键的值
粗茶淡饭9201年前1
天之朱雀 共回答了19个问题 | 采纳率100%
A是错误的,建议查看hibernate API文档,里面有全面的的解释,建议养成查看API文档的习惯。
Hibernate le.. Hibernate le.. Dear DE ah A xin accompany me
Hibernate le.. Hibernate le.. Dear DE ah A xin accompany me together hibernate me
谁能帮我准确的翻译这句英文,
守着谎言的稻草人1年前1
世界很小tt很大 共回答了10个问题 | 采纳率90%
冬眠乐。冬眠乐。亲爱的啊鑫陪我一起冬眠了
hibernate映射在两个持久类做映射时,如果想让A作为主表,B作为从表,那么是不是在A的那端用cascade属性来确
hibernate映射
在两个持久类做映射时,如果想让A作为主表,B作为从表,那么是不是在A的那端用cascade属性来确定其为主表?
nights1年前1
ben9596 共回答了13个问题 | 采纳率92.3%
这个 你应该通过配置谁来维护两者关系来确定 不是通过cascade而是通过inverse
英语翻译Although deer don't hibernate,they do the same thing wit
英语翻译
Although deer don't hibernate,they do the same thing with their seasonal rhythms in metabolism.
子霆1年前2
爱的温暖 共回答了15个问题 | 采纳率100%
尽管鹿不冬眠,但是它们的身体在新陈代谢方面会有同样的季节性节律 (意译)
hibernate 对多表进行查询 比如 A B c c是中间表,通过A的id 获取c中B的id list集合 这个hq
hibernate 对多表进行查询 比如 A B c c是中间表,通过A的id 获取c中B的id list集合 这个hql语句怎么写
怎么没人说话啊?
已经配置了多对多关系,list 页面已经取到它的集合set,想通过 页面list 集合 显示A的信息.
想通过list 列表根据 A中某一条 id 来获取c中B的id list集合 这个hql语句怎么写
甲子伊1年前1
aij23475 共回答了16个问题 | 采纳率81.3%
为什么不配置成多对多的关系呢
user实体
x05@ManyToMany(cascade = { CascadeType.PERSIST,CascadeType.MERGE },
x05x05x05fetch = FetchType.LAZY)
x05@JoinTable(name="T_USER_ROLE",joinColumns={@JoinColumn(name="userid")},
x05x05x05 inverseJoinColumns={@JoinColumn(name="roleid")})
x05private Set roles;
------------------------------------------------
role实体
@ManyToMany(cascade = {CascadeType.PERSIST,CascadeType.MERGE },
x05x05 fetch = FetchType.LAZY,mappedBy="roles")
x05private Set users;
NUMERIC(6,2),我要把这个写到hibernate的映射试题对象的xml里.
NUMERIC(6,2),我要把这个写到hibernate的映射试题对象的xml里.
在xml里给这个定义什么类型呢?应该怎么写?
地瓜媳妇1年前1
好冷啊 共回答了16个问题 | 采纳率87.5%
可以用BigDecimal
e.g:
一道SAT语法题Almost all animals that hibernate prepare for it dur
一道SAT语法题
Almost all animals that hibernate prepare for it during summer by eating large amounts of A B C
food, which they convert to thick layers of fat.No error
D E
选B,
ID己被封1年前1
飞跃之星 共回答了20个问题 | 采纳率85%
应该改成hibernant 要不然句子结构不对
org.hibernate.mappingException:Could not read mappings from
org.hibernate.mappingException:Could not read mappings from resource:
帮帮忙看都是那方面错了
挺起自己的脊梁1年前1
2277959yrn 共回答了16个问题 | 采纳率81.3%
那是由于你的hibernate.cfg.xml中指定的映射文件存在语法错误
以Customer.hbm.xml为例仔细检查一下文件
hibernate中 *.hbm.xml
stoop1231年前1
觉得咖啡苦 共回答了16个问题 | 采纳率81.3%
设置主键
HIbernate主键详解------Native
Native主键生成方式会根据不同的底层数据库自动选择Identity、Sequence、Hilo主键生成方式
特点:根据不同的底层数据库采用不同的主键生成方式.由于Hibernate会根据底层数据库采用不同的映射方式,因此便于程序移植,项目中如果用到多个数据库时,可以使用这种方式
英语翻译能熟练的运用struts、spring、hibernate进行开发,了解其各自特性和应用领域.对新技术能保持较高
英语翻译
能熟练的运用struts、spring、hibernate进行开发,了解其各自特性和应用领域.对新技术能保持较高热情,如现阶段手机应用中的Android、ophone等.
likui19841年前1
haolong8 共回答了25个问题 | 采纳率76%
Proficient in use of struts,the hibernate,development,are about their characteristics and application areas.The new technology can keep high enthusiasm,such as mobile applications at ophone etc.Take,
Struts2 +Spring 3.0+hibernate 3.3 注解异常.expected at least 1 b
Struts2 +Spring 3.0+hibernate 3.3 注解异常.expected at least 1 bean which qualifies as autowir
我用注解来实现的SSH,用@Entity 来标示实体bean,用 来让Spring 来注入,可以在service里面用@Autowiredx05
x05@Qualifier("taUser")
x05TaUser taUser;
来使用这个实体bean的时候就报下面这个错,说找不到,貌似Spring没注入耶.再次万谢各位帮忙解决下(据说是 3.0和3.3 jar 冲突,但是我不知道那个有冲突啊).
Unable to instantiate Action,com.ta.action.UserCreateAction,defined for 'user-create' in namespace '/'Error creating bean with name 'com.ta.action.UserCreateAction':Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException:Could not autowire field:com.ta.service.UserServices com.ta.action.UserCreateAction.userServices; nested exception is org.springframework.beans.factory.BeanCreationException:Error creating bean with name 'userServicesImpl':Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException:Could not autowire field:com.ta.entity.model.TaUser com.ta.service.impl.UserServicesImpl.taUser; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException:No matching bean of type [com.ta.entity.model.TaUser] found for dependency:expected at least 1 bean which qualifies as autowire candidate for this dependency.Dependency annotations:{@org.springframework.beans.factory.annotation.Autowired(required=true),@org.springframework.beans.factory.annotation.Qualifier(value=taUser)}
x05com.opensymphony.xwork2.DefaultActionInvocation.createAction(DefaultActionInvocation.java:318)
x05com.opensymphony.xwork2.DefaultActionInvocation.init(DefaultActionInvocation.java:399)
cmj55551年前0
共回答了个问题 | 采纳率
Animals that hibernate practice energy conservation to a gre
Animals that hibernate practice energy conservation to a greater extreme than deer do.
请教这几个词practice energy conservation .
球迷一个1年前2
jayswift 共回答了14个问题 | 采纳率100%
practice energy conservation
实践节能
Animals that hibernate practice energy conservation to a greater extreme than deer (do).
冬眠的动物保存能量的习性胜过鹿.
Animals that hibernate practice energy conservation to a greater extreme than deer do.Although deer don't hibernate,they do the same thing with their seasonal rhythms in metabolism.
与鹿相比冬眠的动物将能量节约发挥到了极致,尽管鹿并不冬眠,但它们却同样进行着季节性节律的新陈代谢.
Does it practice energy conservation:long-life light bulbs,good insulation,energy-efficient appliances?
有实践节能吗:节能灯泡、良好绝缘、节能家电?
org.hibernate.QueryException:could not resolve property
org.hibernate.QueryException:could not resolve property
could not resolve property:customers of:com.betex.crm.sysmanage.domain.User [ select u from com.betex.crm.sysmanage.domain.User u left outer join u.customers as customer where customer.id=?]
这个出错是什么原因
wanghuaa1年前1
拈花微笑的妞妞 共回答了17个问题 | 采纳率82.4%
你查询的时候有个属性customers跟表里的字段不符合,没有完全匹配上.
hibernate 多对多关系不懂
hibernate 多对多关系不懂
A B 是多对多 就会建立一个中间表 C 然后A C  与  B C 都是一对多关系
我怎么不懂啊!?请举例子说明
min_xiaoyatou1年前1
35deman 共回答了16个问题 | 采纳率93.8%
表 course,student, c_s(学生选课表)
一个学生可以选多门课程
一门课程可以被多个学生选
明白否????
org.hibernate.hql.ast.QuerySyntaxException:unexpected token错
org.hibernate.hql.ast.QuerySyntaxException:unexpected token错误
public Aadmin quaryUserNames(String name) {
String sql = "select * from Eadmin a where a.Aname = ";
Query query = sessionFactory.getCurrentSession().createQuery(sql);
query.setString(0,name);
Aadmin a = (Aadmin)query.uniqueResult();
return a;
}
提示错误:org.hibernate.hql.ast.QuerySyntaxException:unexpected token:* near line 1,column 8 [select * from Eadmin a where a.Aname = ]
但上面的sql语句直接拿到数据库(oracle)中是对的,问怎么改
男色天使1年前1
美麗蝴蝶飛 共回答了15个问题 | 采纳率80%
String sql = "select * from Eadmin a where a.Aname = ";
Query query = sessionFactory.getCurrentSession().createQuery(sql);
query.setString(0,name);
sql = "select * from Eadmin a where a.Aname = "; 你这句话是标准的sql语句,但是你在这里sessionFactory.getCurrentSession().createQuery(sql);开启的是hibernate的面向对象的语句所以不可以,你改成sessionFactory.getCurrentSession().createSQL(sql);就可以了
hibernate 配置中,把一个表字段同时配成id和property,会不会有什么影响?
hibernate 配置中,把一个表字段同时配成id和property,会不会有什么影响?
背景:遗留数据库中,需通过两个字段连添加一对多关联。但是properties里不能嵌套id定义,所以额外配置了一个和id同名的property。















kkkkjjjjj1年前1
b2ayaaa4 共回答了22个问题 | 采纳率81.8%
应该不会有什么问题撒!
Could not read mappings from resource:com/sooyie/hibernate/o
Could not read mappings from resource:com/sooyie/hibernate/orm/Admin.hbm.xml
%%%% Error Creating SessionFactory %%%%
org.hibernate.MappingException:Could not read mappings from resource:com/sooyie/hibernate/orm/Admin.hbm.xml
Caused by:org.hibernate.DuplicateMappingException:Duplicate class/entity mapping com.sooyie.hibernate.orm.Admin
tomcat 启动后报错 报的两个错很郁闷 请教具体原因
HIBERNATE.CFG.XML配置文件中 导入的实体类的映射文件确定是正确的 因为该项目在其他机子上部署是没问题的
实体类配置文件中的类和属性这些映射也都正确
Admin 实体也未重复定义 这些问题我在提问之前都检查过了的
不过现在问题已经解决了 我换了个版本的tomcat 重新部署 具体原因还是没找见!
garymakiyo1年前1
chen9201 共回答了26个问题 | 采纳率92.3%
你首先查下你的HIBERNATE.CFG.XML配置文件中 导入的实体类的映射文件是否正确配置好了
再检查实体类配置文件中的类和属性这些映射是否配置正确
你报的这个错是重复定义了实体类com.sooyie.hibernate.orm.Admin
Hibernate配置文件错误提示,The content of element type "list" must ma
Hibernate配置文件错误提示,The content of element type "list" must match ,怎么解决呢.
The content of element type "list" must match "(meta*,subselect?,cache?,synchronize*,comment?,key,(index|list-index),
(element|one-to-many|many-to-many|composite-element|many-to-any),loader?,sql-insert?,sql-update?,sql-delete?,sql-
delete-all?,filter*)".
配置文件如下,出错在list那一行.
powderbun1年前1
blooddown 共回答了21个问题 | 采纳率95.2%
缺少关联的列
org.hibernate.hql.ast.QuerySyntaxException: expecting OPEN,
org.hibernate.hql.ast.QuerySyntaxException: expecting OPEN, found '>' near line 1, column 38 [from com.sqlt.model.Topic where count>30 and subjectid=4]
at org.hibernate.hql.ast.QuerySyntaxException.convert(QuerySyntaxException.java:31)
at org.hibernate.hql.ast.QuerySyntaxException.convert(QuerySyntaxException.java:24)
at org.hibernate.hql.ast.ErrorCounter.throwQueryException(ErrorCounter.java:59)
at org.hibernate.hql.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:258)
at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:157)
at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:111)
at org.hibernate.engine.query.HQLQueryPlan.(HQLQueryPlan.java:77)
at org.hibernate.engine.query.HQLQueryPlan.(HQLQueryPlan.java:56)
at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:72)
at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:133)
at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:112)
at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1623)
at com.sqlt.dao.daoImp.TopicDAOImp.findTopicByFour(TopicDAOImp.java:127)
at com.sqlt.action.LoginAction.selectLiuyanInfoView(LoginAction.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)at com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:404)
at com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:267)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:229)
at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:221)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:150)
at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:48)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
paint1年前1
肉肉和球球 共回答了18个问题 | 采纳率88.9%
好好检查HQL语句,语法错误
org.hibernate.hql.ast.QuerySyntaxException:, found '>' near
org.hibernate.hql.ast.QuerySyntaxException:, found '>' near line 1, column 39
org.hibernate.hql.ast.QuerySyntaxException: expecting OPEN, found '>' near line 1, column 39 [from com.sqlt.model.Topic where count > 30 and subjectid=4 order by id]
at org.hibernate.hql.ast.QuerySyntaxException.convert(QuerySyntaxException.java:31)
at org.hibernate.hql.ast.QuerySyntaxException.convert(QuerySyntaxException.java:24)
at org.hibernate.hql.ast.ErrorCounter.throwQueryException(ErrorCounter.java:59)
at org.hibernate.hql.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:258)
at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:157)
at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:111)
at org.hibernate.engine.query.HQLQueryPlan.(HQLQueryPlan.java:77)
at org.hibernate.engine.query.HQLQueryPlan.(HQLQueryPlan.java:56)
at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:72)
at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:133)
at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:112)
at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1623)
at com.sqlt.dao.daoImp.TopicDAOImp.findTopicByFour(TopicDAOImp.java:127)
at com.sqlt.action.LoginAction.selectLiuyanInfoView(LoginAction.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:404)
at com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:267)
我的Dao类中的部分代码如下:public List findTopicByTwentyOne()
{
session=HibernateSessionFactory.getSession();
try{

ts=session.beginTransaction();
Query query=session.createQuery("from Topic where count>30 and subjectid=21 order by id");
List list=query.list();
ts.commit();
return list;

}catch(Exception e)
{
e.printStackTrace();
return null;
}
}
鸡落李维hh1年前1
xiaoling6070 共回答了19个问题 | 采纳率94.7%
你先试试你的hql有没有问题,你这样弄会很麻烦的,首先你得确定你的hql没问题才行.你的myeclipse里面有个hql 编辑工具 ,你输入你的hql查询下.
插入语出现在两个并列句中间Some animals only half-hibernate,that is to say
插入语出现在两个并列句中间
Some animals only half-hibernate,that is to say,their sleep is not such a deep one.像这个句子,把插入语去掉两个句子结构不对啊~
Helen198409281年前1
tongtongle 共回答了10个问题 | 采纳率90%
插入语主要起到补充说明作用.
The cat ________ hibernate in winter.
The cat ________ hibernate in winter.
A. don't need
B. doesn't need to
C. needs not to
D. needs not
qisirenla1年前1
ubta1h 共回答了25个问题 | 采纳率92%
答案B
need和dare既可用于实义动词,也可用于情态动词,用于实义动词时后面可接名词/to do/doing.
the cat ___hibernate in winter .A doesn't need to B needn't
the cat ___hibernate in winter .A doesn't need to B needn't C mustn't D shouldn't 答案给的的D 为什
b94541fee80442ed1年前1
jackson601 共回答了17个问题 | 采纳率88.2%
分析:
此题要表达的是一个科学现象,此句的意思是:猫不应在冬季冬眠.
A选项:need做的是实义动词,表示无需,与题意不符pass.
B选项:need做的是情态动词,表示不必,也与题意不符.
C选项:mustn't表示禁止之意.
hibernate报错 jdbc:mysql://localhost/xpr?useUnicode=true&chara
hibernate报错

jdbc:mysql://localhost/xpr?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true

该怎样该?
58866551年前1
hj11223344 共回答了17个问题 | 采纳率88.2%
什么错...
跟你讲个很简单的原理
spring管理Hibernate的sessionfactory
然后对应的dao类注入到spring里就行了..
其实很简单的..你看看是不是你的spring配置文件里.创建sessionfactory的那个bean的value没有正确的指向hibernate的配置文件
Animals that hibernate practice energy conservation to a gre
Animals that hibernate practice energy conservation to a greater extreme than deer do.
吴马峰1年前3
由自不他 共回答了20个问题 | 采纳率85%
冬眠的动物,比起鹿来,更能节约能源.
Animals (that hibernate ) 括号内是定语从句.
practice energy conservation 谓语宾语.
to a greater extreme 补足语. than deer do.比较状语.
请问Hibernate中有个 ,是主键生成策略,
请问Hibernate中有个 ,是主键生成策略,
请问这里的生成主键是什么意思
悠郁小子1年前1
变种病毒 共回答了20个问题 | 采纳率85%
是数据库中一个表中,唯一与其他记录做区别的字段,比如常见的网站登录程序,登录帐号必须是唯一的,这就是主键,class="assigned"说明主键是自己定的,不是数据库生成的,用户注册的帐号一般就属于这种类型.
Some animals hibernate under snow,because there is much air
Some animals hibernate under snow,because there is much air in l____ snow
rainy想飞1年前2
gegeweibinbin 共回答了17个问题 | 采纳率88.2%
loose 形容词 松的