| How do you select delimit-identifiers at runtime? [message #557547] |
Wed, 08 September 2010 00:36  |
Rich Mayfield Messages: 44 Registered: August 2010 |
Member |
|
|
In some circumstances I need to enable delimit-identifiers and others I need this disabled. I know in orm.xml you enable this by including:
<persistence-unit-metadata>
<persistence-unit-defaults>
<delimited-identifiers/>
</persistence-unit-defaults>
</persistence-unit-metadata>
What I would like to do is remove this from orm.xml and then programatically enable the functionality when I detect that it is necessary.
We do use Spring ORM 3.0.3 (with org.springframework.orm.jpa.LocalContainerEntityManagerFacto ryBean to make entity manager factory available). It is not clear to me if the solution is in EclipseLink or Spring to be honest, but after a fair amount of poking around the source nothing leaps out.
Any pointers are greatly appreciated. Thanks much.
|
|
|
| Re: How do you select delimit-identifiers at runtime? [message #558615 is a reply to message #557547] |
Mon, 13 September 2010 13:08  |
James Sutherland Messages: 1844 Registered: July 2009 |
Senior Member |
|
|
There does not seem to be a convenient runtime setting for this (perhaps log a bug/enhancement), but there are some ways to do this at runtime.
You could use a Descriptor or SessionCustomizer to loop through your ClassDescriptor and set setUseDelimiters(true) on the DatabaseTable and DatabaseField (getTables(), getFields()) objects.
Or you could get the DatabasePlatform from the Session and set the start and endDelimiter to "".
James : Wiki : Book : Blog
|
|
|
Powered by
FUDForum. Page generated in 0.08074 seconds