Hi,

Yup, that sounds like an appropriate fix.

Since OPENJPA-455 has not shipped, could you just attach a patch that
fixes the classes to OPENJPA-455 and reopen the issue?

Thanks,

-Patrick

On Jan 29, 2008 9:50 AM, Joseph Weinstein <[EMAIL PROTECTED]> wrote:
>
>  Hi all.
>  I think I've found a problem here. Oracle has a NUMBER
>  column type, which may be specified with sizes, eg:
>  NUMBER(7), or NUMBER(9,3), but may also be unsized,
>  eg: NUMBER. Since this fix, the new code is failing to
>  process the "NUMBER{0}" template for non-sized
>  columns, so the DDL sent to the DBMS is like:
>
>  CREATE TABLE ABSTRACTMAPPEDAPPIDSUPER ( ..., VERSN NUMBER{0}, ...
>
>  which needless to say, dies.
>
>  A change I made to DBDictionary, that fixed this for me is:
>
>      protected String insertSize(String typeName, String size) {
>          if(StringUtils.isEmpty(size)) {
>
>            int idx = typeName.indexOf("{0}"); // remove the size token if
> not needed...
>            if (idx != -1) {
>              return typeName.substring(0,idx);
>            }
>            return typeName;
>          }
>
>          int idx = typeName.indexOf("{0}");
>  ...
>
>
>  ie:
>
>  Index:
> openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java
>  ===================================================================
>  ---
> openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java
> (revision 610999)
>  +++
> openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java
> (working copy)
>  @@ -1648,8 +1648,13 @@
>        */
>       protected String insertSize(String typeName, String size) {
>          if(StringUtils.isEmpty(size)) {
>  - return typeName;
>  - }
>  +
>  + int idx = typeName.indexOf("{0}");
>  + if (idx != -1) {
>  + return typeName.substring(0,idx);
>  + }
>  + return typeName;
>  + }
>
>           int idx = typeName.indexOf("{0}");
>           if (idx != -1) {
>
>  Please let me know what you think, and how to absorb this
>  change, or it's purpose. thanks,
>  Joe Weinstein at BEA Systems
>  Notice: This email message, together with any attachments, may contain
> information of BEA Systems, Inc., its subsidiaries and affiliated entities,
> that may be confidential, proprietary, copyrighted and/or legally
> privileged, and is intended solely for the use of the individual or entity
> named in this message. If you are not the intended recipient, and have
> received this message in error, please immediately return this by email and
> then delete it.



-- 
Patrick Linskey
202 669 5907

Reply via email to