Moreover, when I try to remplace DefaultIdentifierConfiguration by
MySQLDictionary, just to test, NPE is raised since default identifier rule
is not set and getDefaultIdentifierRule() return null.

Yves

On 13 June 2018 at 14:31, ypiel <ypiel.talend....@gmail.com> wrote:

> Hi,
>
> To be more precise, it is not DBIdentifier#setName but the
> Normalizer#normalizer that is static:
>
> https://github.com/apache/openjpa/blob/ffe3fe4a5051632d15973a00847676
> 12ab22ad17/openjpa-jdbc/src/main/java/org/apache/openjpa/
> jdbc/identifier/Normalizer.java#L33
> ------------------------------------
> public class Normalizer {
>
>     private static IdentifierUtil normalizer =
>             new DBIdentifierUtilImpl(new DefaultIdentifierConfiguration
> ());
>
>     private static IdentifierRule defaultRule;
>
>     static {
>         defaultRule =
> normalizer.getIdentifierConfiguration().getDefaultIdentifierRule();
>     }
>
>     ....
>
>     public static String delimit(String name, boolean force) {
>         return normalizer.delimit(defaultRule, name, force);
>     }
> ------------------------------------
>
> And as you can see the Normalizer#delimit method use the static
> IdentifierUtil which is configured with the DefaultIdentifierConfiguration
> .
> It does not take into account the dictionary.
>
> So when you call something like DBIdentifier.newSchema("My-schema"), it
> always use DefaultIdentifierConfiguration to delimit identifier.
>
> Regards,
> Yves
>
>
>
> --
> Sent from: http://openjpa.208410.n2.nabble.com/OpenJPA-Developers-
> f210739.html
>

Reply via email to