[ 
https://issues.apache.org/jira/browse/OPENJPA-1449?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12801367#action_12801367
 ] 

Milosz Tylenda commented on OPENJPA-1449:
-----------------------------------------

I guess the behaviour exists because OpenJPA modifies column name if it is an 
SQL 92 reserved word even if a particular database allows it to be a column 
name.

I can see these potential workarounds:
1. Extend SQLServerDictionary and override endConfiguration(). Call super and 
modify reservedWordSet variable as you wish.
2. Modify org/apache/openjpa/jdbc/sql/sql-keywords.rsrc which is included in 
OpenJPA jar or provide your own and somehow make the classloader load it first.



> TableGenerator pkColumnName / valueColumnName cannot be "name" / "value" 
> respectively
> -------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-1449
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1449
>             Project: OpenJPA
>          Issue Type: Bug
>    Affects Versions: 1.2.1
>         Environment: IBM 1.5 JDK
> databasePlatform=org.apache.openjpa.jdbc.sql.SQLServerDictionary
>            Reporter: John Selby
>            Priority: Minor
>
>       @Id
>       @GeneratedValue(strategy=GenerationType.TABLE,generator="KeyGen")
>       @TableGenerator(name="KeyGen", table="rtt_sequence_number", 
> pkColumnName="name",
>         valueColumnName="value", pkColumnValue="como")
> Results in a query:
> SELECT VALUE0 FROM rtt_sequence_number WITH (UPDLOCK) WHERE NAME0 = ? 
> [params=(String) como]
> The extra "zero" appended to the end of the string causes the query to fail.
> Using any other values for pkColumnName and valueColumnName results in valid 
> SQL (where the values for pkColumnName and valueColumnName match the 
> annotation)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to