Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/hibernate/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Hibernate HQL是否具有与SQL COVERT()等效的函数_Hibernate_Hql - Fatal编程技术网

Hibernate HQL是否具有与SQL COVERT()等效的函数

Hibernate HQL是否具有与SQL COVERT()等效的函数,hibernate,hql,Hibernate,Hql,我正在使我们的SQL查询适应hql,但当其中一个查询使用CONVERT()函数时遇到了障碍。我在网上找不到关于hql的任何信息 查询: "SELECT tse.id, tse.ts_entries_ParentID As ParentID, tse.hours, tse.project As projectID, (SELECT CONCAT(Project_Pastel_Prefix, ' - ', Project_Descripti

我正在使我们的SQL查询适应hql,但当其中一个查询使用CONVERT()函数时遇到了障碍。我在网上找不到关于hql的任何信息

查询:

"SELECT tse.id, tse.ts_entries_ParentID As ParentID, tse.hours, 

                            tse.project As projectID, (SELECT CONCAT(Project_Pastel_Prefix, ' - ', Project_Description) FROM Project WHERE Project_Code = tse.project) As 'projectName',
                            tse.task As taskID, (SELECT Budget FROM TimesheetCategories WHERE id = tse.task) As 'taskName',
                            tse.task As oldTaskID, (SELECT name FROM ts_tasks WHERE id = tse.task) As 'oldTaskName',

                            IF(STRCMP(tse.comment,'') = 0, (SELECT CONCAT(Project_Pastel_Prefix, ' - ', Project_Description) FROM Project WHERE Project_Code = tse.project), tse.comment) As 'text', 
                            tse.user As userID, tse.customer As customerID,
                            concat(tsw.ts_working_hours_Date, ' ',tsw.ts_working_hours_Time_Start) As startDate, concat(tsw.ts_working_hours_Date, ' ',tsw.ts_working_hours_Time_End) As endDate,
                            CONVERT(1, UNSIGNED) As TypeId,
                            if(tsw.ts_working_hours_Date BETWEEN '1994-01-01' AND '2018-03-31', 2, 1) as TemplateID,

                            0 AS 'days',
                            0 AS 'isDoc',
                            '0' AS 'authorised',
                            tse.comment AS 'description',
                            0 AS 'leaveType',
                            0 AS 'isApproved'

                            FROM ts_entries tse, ts_working_hours tsw
                            WHERE tse.ts_entries_ParentID = tsw.ts_working_hours_ID
                            AND tse.user = :userID
                            AND tsw.ts_working_hours_Date BETWEEN ':startDate' AND ':endDate'

您可以使用cast函数作为

cast(1 as UNSIGNED)