Project

General

Profile

Feature #2358

HQLPreprocessor and dialect specific functions

Added by Ovidiu Maxiniuc almost 10 years ago. Updated over 7 years ago.

Status:
WIP
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
Due date:
% Done:

0%

billable:
No
vendor_id:
GCD
version:

om_upd20150401a.zip (27.9 KB) Ovidiu Maxiniuc, 04/01/2015 02:53 PM

History

#1 Updated by Ovidiu Maxiniuc almost 10 years ago

At this moment HQLPreprocessor must preprocess the HQL code depending on the dialect.
The rtrim function is replaced with a small tree for H2 and PostgreSQL. The SQL Server, however, requires a much larger tree to be constructed (documented in the code).
The issue is the place this code as P2JDialect and HQLPreprocessor are at this moment very disjoint. Normally, HQLPreprocessor should call some function of the current dialect to perform the AST building for rtrim function. On the other hand, P2JDialect has nothing to do with AST building.
It would be nicer to have a pluggable resource that would generate the appropriate AST by dialect.

#2 Updated by Vadim Nebogatov about 9 years ago

  • Status changed from New to WIP

#3 Updated by Ovidiu Maxiniuc about 9 years ago

Vadim,
Please take a look at the attached version of the HQLPreprocessor. It contains some further changes needed by SQLServer dialect. Most likely it won't compile with your current P2J, but please take note of changes at lines: 1340 and 1480 as an addition to 1293 where this dialect receives special treatment.
Should you have any questions, feel free to contact me.

#4 Updated by Vadim Nebogatov about 9 years ago

Sorry, I changed status by mistake, task I am working now is #2538, not #2358...

As for this task, I remember we discussed rtrim in #2141 and I even implemented SQL function for this purpose (notes 68/69). Or you are searching for another solution?

#5 Updated by Ovidiu Maxiniuc about 9 years ago

The reason for this task is not changing the rtrim function support, but to extract the dialect specific code (to P2JDialect implementations? or some other specialized class) in a way that will leave the HQLPreprocessor class dialect independent.

#6 Updated by Eric Faulhaber about 8 years ago

  • Target version set to 23

#7 Updated by Greg Shah over 7 years ago

  • Target version deleted (23)

Also available in: Atom PDF