openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Simons (JIRA)" <j...@apache.org>
Subject [jira] Updated: (OPENJPA-1144) Improve support of key generator tables
Date Thu, 06 Aug 2009 10:48:16 GMT

     [ https://issues.apache.org/jira/browse/OPENJPA-1144?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Michael Simons updated OPENJPA-1144:
------------------------------------

    Attachment: persistence.xml

@Michael Dick: 
Hello Michael, 
Attached the persistence.xml as you requested. Please let me know if you need more information.
 When possible let me know by email at my profile-given address, because I do not look at
this issue daily.
Kind Regards,
Michael

> Improve support of key generator tables
> ---------------------------------------
>
>                 Key: OPENJPA-1144
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1144
>             Project: OpenJPA
>          Issue Type: Improvement
>    Affects Versions: 1.2.1
>         Environment: OS independent, at least on MS SQL Server and MySQL 5
>            Reporter: Michael Simons
>            Priority: Minor
>         Attachments: persistence.xml
>
>   Original Estimate: 0h
>  Remaining Estimate: 0h
>
> The annotation to tell OpenJPA there's a Table Generator:
>     @TableGenerator(name = "pkGenSessionConfig", table = "jdo_keygen", pkColumnName =
> "table_name", valueColumnName = "last_used_id", pkColumnValue = "session_config", allocationSize
> = 10)
>     @Id
>     @GeneratedValue(strategy=GenerationType.TABLE, generator="pkGenSessionConfig")
>     @Column(name="session_config_id", unique=true, nullable=false)
>     private int id;
> And here's the according SQL generated by OpenJPA:
> Unknown column 'TABLE_NAME0' in 'where clause' {prepstmnt 32845046 SELECT LAST_USED_ID
FROM
> jdo_keygen WHERE TABLE_NAME0 = ? FOR UPDATE [params=(String) session_config]} [code=1054,
> state=42S22]
> Fay Wang told us that the name "TABLE_NAME0" is created by OpenJPA because DBDictionary.getValidColumnName
returns  "table_name0" where we want "table_name".
> Obvisouly "table_name" is _not_ assumed to be a valid column name, but that is not quite
correct, because at least for the DBMS MySQL 5 and MS SQL Server it's legal. 
> Furthermore we would appreciate the possibility to influence what's assumed  a valid
name for columns, tables and so on.

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


Mime
View raw message