search
HomeJavaQuery gets syntax error even though query is indeed correct

php editor Youzi will help you solve common problems in Java programming! Sometimes even if the query statement is correct, there may be syntax errors, which confuses many beginners. This article will discuss this issue to help readers deeply understand common errors in Java programming and solve the challenge of grammatical errors in query statements.

Question content

I am planning to deploy my ear file on glassfish, but when I try to deploy the ear I get:

2023-11-23t10:46:59.388 0100|Critical: An exception occurred while calling the class org.glassfish.persistence.jpa.jpadeployer prepare method 2023-11-23t10:46:59.389 0100|Critical: Calling the class Exception occurred while preparing method org.glassfish.javaee.full.deployment.eardeployer 2023-11-23t10:46:59.389 0100|Critical: Exception occurred while preparing application 2023-11-23t10:46:59.389 0100|Critical: Exception[ eclipselink - 8025] (eclipse Persistence Service - 2.3.2.v20111125-r10461): org.eclipse.persistence.exceptions.jpqlexception Exception description: Syntax error while parsing query

The query is a named query, I also tested it using eclipselink in another project not using glassfish (it was not deployed on the application server) and it worked fine;

I can't figure out what could be going wrong, if the query runs fine using it directly, why doesn't it work when deployed on glassfish?

This is a named query

@Entity
@Table(name = "T_EXE_PROC")
@TableGenerator(name = "ExecuProcGenerator", table = "T_SEQ", pkColumnName = "SEQ_COL", valueColumnName = "SEQ_CONTATOR", pkColumnValue = "EXE_PRO_SEQUE", allocationSize = 10, initialValue = 0)
@NamedQueries({ 

        @NamedQuery(name = "ExeProc.findLastExecProcs", query = "SELECT DISTINCT (e.procedure) FROM ExeProc e WHERE e.cdExecProcs IN ( SELECT DISTINCT (e.cdExecProcs) FROM ExeProc e, ExeStep s where s.ExecProc.cdExecProcs = e.cdExecProcs AND s.stat.cdStation=:cdStation and s.oper.ceLogin=:ceLogin) and e.statusExecProc = :statusExecProc and e.procedure.status = 1 order by e.lastModifiedStepTime DESC"),

        })
public class ExeProc implements Serializable {
    
    private static final long serialVersionUID = 12348979846545312L;
    
    
    public static final String FIND_LAST_EXEC_PROC = "ExeProc.findLastExecProcs";

I have used this query in a java application (a simple java project) and it works fine; The database is mssql

Solution

The problem is related to the glassfish version, in this version

It works fine, and in this one:

does not work, in other words, the open source version cannot perform very complex queries (such as the query in the example);

I know there's probably no one else on the planet who has the problem I'm having, and the technology is very old; but I don't understand why someone took my two cents away! !

The above is the detailed content of Query gets syntax error even though query is indeed correct. For more information, please follow other related articles on the PHP Chinese website!

Statement
This article is reproduced at:stackoverflow. If there is any infringement, please contact admin@php.cn delete

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
1 months agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.