Hello,
I have a case sensitiv problem and we use MS SQL.
I'd like to do something like
Code:
VALUE IN (SELECT VALUE ......
But this check has to be case sensitiv. I've found an SQL-Function that works, but not in HQL.
Kind of:
Code:
BINARY_CHECKSUM(VALUE) IN (SELECT BINARY_CHECKSUM(VALUE) ......
I've tried:
Code:
FROM WochenplanZusatzcodeDB _WochenplanZusatzcodeDB WHERE BINARY_CHECKSUM(_WochenplanZusatzcodeDB.zeichen)=?
It works without a problem but if i do
Code:
SELECT BINARY_CHECKSUM(_WochenplanZusatzcodeDB.zeichen) FROM WochenplanZusatzcodeDB _WochenplanZusatzcodeDB
Following exception happens:
Code:
Caused by: java.lang.IllegalStateException: No data type for node: org.hibernate.hql.ast.tree.MethodNode
\-[METHOD_CALL] MethodNode: '('
+-[METHOD_NAME] IdentNode: 'BINARY_CHECKSUM' {originalText=BINARY_CHECKSUM}
\-[EXPR_LIST] SqlNode: 'exprList'
\-[DOT] DotNode: 'wochenplan0_.ZEICHEN' {propertyName=zeichen,dereferenceType=ALL,propertyPath=zeichen,path=_WochenplanZusatzcodeDB.zeichen,tableAlias=wochenplan0_,className=ch.siaxma.hibernate.data.WochenplanZusatzcodeDB,classAlias=_WochenplanZusatzcodeDB}
+-[ALIAS_REF] IdentNode: 'wochenplan0_.TAB_ID' {alias=_WochenplanZusatzcodeDB, className=ch.siaxma.hibernate.data.WochenplanZusatzcodeDB, tableAlias=wochenplan0_}
\-[IDENT] IdentNode: 'zeichen' {originalText=zeichen}
at org.hibernate.hql.ast.tree.SelectClause.initializeExplicitSelectClause(SelectClause.java:157)
at org.hibernate.hql.ast.HqlSqlWalker.useSelectClause(HqlSqlWalker.java:827)
at org.hibernate.hql.ast.HqlSqlWalker.processQuery(HqlSqlWalker.java:632)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:685)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:301)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:244)
at org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:254)
at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:185)
at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:136)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:101)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:80)
at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:124)
Why doesn't it work? What do i do wrong?
Thanks for helping
Gepi