HQL 写法 SQL
程序员文章站
2022-07-12 10:51:11
...
HQL BNF query: [selectClause] fromClause [whereClause] [groupByClause] [havingClause] [orderByClause]; selectClause: SELECT DISTINCT? selectedPropertiesList | ( NEW className OPEN selectedPropertiesList CLOSE );; fromClause: FROM className AS? identifier ( ( COMMA className AS? identifier ); | ( joinType path AS? identifier ); );*; joinType: ( ( 'left'|'right' 'outer'? ); | 'full' | 'inner' );? JOIN FETCH?; groupByClause: GROUP_BY path ( COMMA path );*; orderByClause: ORDER_BY selectedPropertiesList; havingClause: HAVING logicalExpression; whereClause: WHERE logicalExpression; selectedPropertiesList: ( path | aggregate ); ( COMMA path | aggregate );*; aggregate: ( aggregateFunction OPEN path CLOSE ); | ( COUNT OPEN STAR CLOSE ); | ( COUNT OPEN DISTINCT | ALL path CLOSE );; aggregateFunction: COUNT | 'sum' | 'avg' | 'max' | 'min'; logicalExpression: TODO! expression: TODO! collection: ( OPEN query CLOSE ); | ( 'elements'|'indices' OPEN path CLOSE );; quantifiedExpression: 'exists' | ( expression 'in' ); | ( expression OP 'any' | 'some' ); collection; compoundPath: path ( OPEN_BRACKET expression CLOSE_BRACKET ( '.' path );? );*; path: identifier ( '.' identifier );*; className: path; OP: EQ | LT | GT | LE | GE | NE | SQL_NE | LIKE; AS: 'as'; DISTINCT: 'distinct'; ALL: 'all'; COUNT: 'count'; SELECT: 'select'; FROM: 'from'; JOIN: 'join'; FETCH: 'fetch' BY: 'by'; GROUP_BY: 'group' BY; ORDER_BY: 'order' BY; HAVING: 'having'; WHERE: 'where'; NEW: 'new'; LIKE: 'like'; EQ: '='; LT: '<'; GT: '>'; SQL_NE: "<>"; NE: "!=" | "^="; LE: "<="; GE: ">="; COMMA: ','; OPEN: '('; CLOSE: ');'; OPEN_BRACKET: '['; CLOSE_BRACKET: ']'; CONCAT: "||"; PLUS: '+'; MINUS: '-'; STAR: '*'; DIV: '/';
上一篇: Eclipse中如何添加Jbpm插件
下一篇: spring与jbpm的整合