Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 365872

Summary: Not properly DDL generating
Product: z_Archived Reporter: shenzl <lxrjszl>
Component: EclipselinkAssignee: Nobody - feel free to take it <nobody>
Status: CLOSED INVALID QA Contact:
Severity: normal    
Priority: P3 CC: tom.ware
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description shenzl CLA 2011-12-07 07:23:55 EST
Build Identifier: elipseLink 2.3.0,elipseLink 2.3.1

org.springframework.web.util.NestedServletException: Request processing failed; nested exception is Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.3.1.v20111018-r10243): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ASC LIMIT 0, 15' at line 1
Error Code: 1064
Call: SELECT t1.ID AS a1, t1.CODE AS a2, t1.DESCRIPTION AS a3, t1.NAME AS a4, t1.VERSION AS a5, t1.TYPE_ID AS a6 FROM T_DICTIONARY t0, T_DICTIONARY t1 WHERE (t0.ID = t1.TYPE_ID) ORDER BY  ASC LIMIT ?, ?
	bind => [2 parameters bound]

Reproducible: Always

Steps to Reproduce:
1.create an entity with a property named a word that reserved by database,such as 'name','type'
2.use it to crate an Order clause with CriteriaBuilder( see toJpaOrder in org.springframework.data.jpa.repository.support.SimpleJpaRepository  )
Comment 1 Tom Ware CLA 2011-12-14 16:10:02 EST
EclipseLink will not validate your attribute names against the various reserved words used by databases.  The collection of those words for all possible databases is simply too big and to changeable.
Comment 2 Eclipse Webmaster CLA 2022-06-09 10:32:26 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink