You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-dev@db.apache.org by "Scott Eade (JIRA)" <ji...@apache.org> on 2006/06/20 05:42:29 UTC

[jira] Created: (TORQUE-32) Native id-method columns in hsqldb start with 0

Native id-method columns in hsqldb start with 0
-----------------------------------------------

         Key: TORQUE-32
         URL: http://issues.apache.org/jira/browse/TORQUE-32
     Project: Torque
        Type: Bug

  Components: Generator  
 Environment: Any.
    Reporter: Scott Eade
    Priority: Minor


Using hsqldb with id-method native columns creates columns defined with the constraint "IDENTITY". This generated an index starting with 0. As Torque regards objects with an primary key 0 as not initialized, this can lead to problems when using relationships between tables. 

To prevent this I've patched the generated string from "IDENTITY" to "GENERATED BY DEFAULT AS IDENTITY (STARTING WITH 0)".

This broke the created SQL for hsqldb tables since Torque preprends the String "NOT NULL" in front of the identity string. hsqldb does not allow this.

To change this I've patched the interface org.apache.torque.engine.platform.Platform and added a method "public getNullString(Column col)" since the PlatformHypersonicImpl needed to know if the column is a not null and if the column uses the native id-method. The default implementation of Platform delegates the call of this method to the former existing one. Only the hsqldb implementation uses more than the property notNull of the column.

The new method is now used getSqlString of class Column.


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


[jira] Assigned: (TORQUE-32) Native id-method columns in hsqldb start with 0

Posted by "Thomas Fischer (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/TORQUE-32?page=all ]

Thomas Fischer reassigned TORQUE-32:
------------------------------------

    Assign To: Thomas Fischer

> Native id-method columns in hsqldb start with 0
> -----------------------------------------------
>
>          Key: TORQUE-32
>          URL: http://issues.apache.org/jira/browse/TORQUE-32
>      Project: Torque
>         Type: Bug

>   Components: Generator
>  Environment: Any.
>     Reporter: Scott Eade
>     Assignee: Thomas Fischer
>     Priority: Minor
>  Attachments: Column.java.patch, HypersonicDomainTest.java.patch, Platform.java.patch, PlatformDefaultImpl.java.patch, PlatformHypersonicImpl.java.patch
>
> Using hsqldb with id-method native columns creates columns defined with the constraint "IDENTITY". This generated an index starting with 0. As Torque regards objects with an primary key 0 as not initialized, this can lead to problems when using relationships between tables. 
> To prevent this I've patched the generated string from "IDENTITY" to "GENERATED BY DEFAULT AS IDENTITY (STARTING WITH 0)".
> This broke the created SQL for hsqldb tables since Torque preprends the String "NOT NULL" in front of the identity string. hsqldb does not allow this.
> To change this I've patched the interface org.apache.torque.engine.platform.Platform and added a method "public getNullString(Column col)" since the PlatformHypersonicImpl needed to know if the column is a not null and if the column uses the native id-method. The default implementation of Platform delegates the call of this method to the former existing one. Only the hsqldb implementation uses more than the property notNull of the column.
> The new method is now used getSqlString of class Column.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


[jira] Closed: (TORQUE-32) Native id-method columns in hsqldb start with 0

Posted by "Thomas Vandahl (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/TORQUE-32?page=all ]

Thomas Vandahl closed TORQUE-32.
--------------------------------


> Native id-method columns in hsqldb start with 0
> -----------------------------------------------
>
>                 Key: TORQUE-32
>                 URL: http://issues.apache.org/jira/browse/TORQUE-32
>             Project: Torque
>          Issue Type: Bug
>          Components: Generator
>         Environment: Any.
>            Reporter: Scott Eade
>         Assigned To: Thomas Fischer
>            Priority: Minor
>             Fix For: 3.3
>
>         Attachments: Column.java.patch, HypersonicDomainTest.java.patch, Platform.java.patch, PlatformDefaultImpl.java.patch, PlatformHypersonicImpl.java.patch
>
>
> Using hsqldb with id-method native columns creates columns defined with the constraint "IDENTITY". This generated an index starting with 0. As Torque regards objects with an primary key 0 as not initialized, this can lead to problems when using relationships between tables. 
> To prevent this I've patched the generated string from "IDENTITY" to "GENERATED BY DEFAULT AS IDENTITY (STARTING WITH 0)".
> This broke the created SQL for hsqldb tables since Torque preprends the String "NOT NULL" in front of the identity string. hsqldb does not allow this.
> To change this I've patched the interface org.apache.torque.engine.platform.Platform and added a method "public getNullString(Column col)" since the PlatformHypersonicImpl needed to know if the column is a not null and if the column uses the native id-method. The default implementation of Platform delegates the call of this method to the former existing one. Only the hsqldb implementation uses more than the property notNull of the column.
> The new method is now used getSqlString of class Column.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


[jira] Commented: (TORQUE-32) Native id-method columns in hsqldb start with 0

Posted by "Thomas Fischer (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/TORQUE-32?page=comments#action_12417185 ] 

Thomas Fischer commented on TORQUE-32:
--------------------------------------

Verified that the problem with the "NOT NULL" still exists in the current SVN revision.

> Native id-method columns in hsqldb start with 0
> -----------------------------------------------
>
>          Key: TORQUE-32
>          URL: http://issues.apache.org/jira/browse/TORQUE-32
>      Project: Torque
>         Type: Bug

>   Components: Generator
>  Environment: Any.
>     Reporter: Scott Eade
>     Assignee: Thomas Fischer
>     Priority: Minor
>  Attachments: Column.java.patch, HypersonicDomainTest.java.patch, Platform.java.patch, PlatformDefaultImpl.java.patch, PlatformHypersonicImpl.java.patch
>
> Using hsqldb with id-method native columns creates columns defined with the constraint "IDENTITY". This generated an index starting with 0. As Torque regards objects with an primary key 0 as not initialized, this can lead to problems when using relationships between tables. 
> To prevent this I've patched the generated string from "IDENTITY" to "GENERATED BY DEFAULT AS IDENTITY (STARTING WITH 0)".
> This broke the created SQL for hsqldb tables since Torque preprends the String "NOT NULL" in front of the identity string. hsqldb does not allow this.
> To change this I've patched the interface org.apache.torque.engine.platform.Platform and added a method "public getNullString(Column col)" since the PlatformHypersonicImpl needed to know if the column is a not null and if the column uses the native id-method. The default implementation of Platform delegates the call of this method to the former existing one. Only the hsqldb implementation uses more than the property notNull of the column.
> The new method is now used getSqlString of class Column.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


[jira] Commented: (TORQUE-32) Native id-method columns in hsqldb start with 0

Posted by "Scott Eade (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/TORQUE-32?page=comments#action_12416843 ] 

Scott Eade commented on TORQUE-32:
----------------------------------

Patch came from Patrick Carl (patrick dot carl at web dot de).

> Native id-method columns in hsqldb start with 0
> -----------------------------------------------
>
>          Key: TORQUE-32
>          URL: http://issues.apache.org/jira/browse/TORQUE-32
>      Project: Torque
>         Type: Bug

>   Components: Generator
>  Environment: Any.
>     Reporter: Scott Eade
>     Priority: Minor
>  Attachments: Column.java.patch, HypersonicDomainTest.java.patch, Platform.java.patch, PlatformDefaultImpl.java.patch, PlatformHypersonicImpl.java.patch
>
> Using hsqldb with id-method native columns creates columns defined with the constraint "IDENTITY". This generated an index starting with 0. As Torque regards objects with an primary key 0 as not initialized, this can lead to problems when using relationships between tables. 
> To prevent this I've patched the generated string from "IDENTITY" to "GENERATED BY DEFAULT AS IDENTITY (STARTING WITH 0)".
> This broke the created SQL for hsqldb tables since Torque preprends the String "NOT NULL" in front of the identity string. hsqldb does not allow this.
> To change this I've patched the interface org.apache.torque.engine.platform.Platform and added a method "public getNullString(Column col)" since the PlatformHypersonicImpl needed to know if the column is a not null and if the column uses the native id-method. The default implementation of Platform delegates the call of this method to the former existing one. Only the hsqldb implementation uses more than the property notNull of the column.
> The new method is now used getSqlString of class Column.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


[jira] Updated: (TORQUE-32) Native id-method columns in hsqldb start with 0

Posted by "Thomas Fischer (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/TORQUE-32?page=all ]

Thomas Fischer updated TORQUE-32:
---------------------------------

    Comment: was deleted

> Native id-method columns in hsqldb start with 0
> -----------------------------------------------
>
>          Key: TORQUE-32
>          URL: http://issues.apache.org/jira/browse/TORQUE-32
>      Project: Torque
>         Type: Bug

>   Components: Generator
>  Environment: Any.
>     Reporter: Scott Eade
>     Assignee: Thomas Fischer
>     Priority: Minor
>      Fix For: 3.2.1
>  Attachments: Column.java.patch, HypersonicDomainTest.java.patch, Platform.java.patch, PlatformDefaultImpl.java.patch, PlatformHypersonicImpl.java.patch
>
> Using hsqldb with id-method native columns creates columns defined with the constraint "IDENTITY". This generated an index starting with 0. As Torque regards objects with an primary key 0 as not initialized, this can lead to problems when using relationships between tables. 
> To prevent this I've patched the generated string from "IDENTITY" to "GENERATED BY DEFAULT AS IDENTITY (STARTING WITH 0)".
> This broke the created SQL for hsqldb tables since Torque preprends the String "NOT NULL" in front of the identity string. hsqldb does not allow this.
> To change this I've patched the interface org.apache.torque.engine.platform.Platform and added a method "public getNullString(Column col)" since the PlatformHypersonicImpl needed to know if the column is a not null and if the column uses the native id-method. The default implementation of Platform delegates the call of this method to the former existing one. Only the hsqldb implementation uses more than the property notNull of the column.
> The new method is now used getSqlString of class Column.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


[jira] Updated: (TORQUE-32) Native id-method columns in hsqldb start with 0

Posted by "Scott Eade (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/TORQUE-32?page=all ]

Scott Eade updated TORQUE-32:
-----------------------------

    Attachment: PlatformDefaultImpl.java.patch
                PlatformHypersonicImpl.java.patch

> Native id-method columns in hsqldb start with 0
> -----------------------------------------------
>
>          Key: TORQUE-32
>          URL: http://issues.apache.org/jira/browse/TORQUE-32
>      Project: Torque
>         Type: Bug

>   Components: Generator
>  Environment: Any.
>     Reporter: Scott Eade
>     Priority: Minor
>  Attachments: Column.java.patch, HypersonicDomainTest.java.patch, Platform.java.patch, PlatformDefaultImpl.java.patch, PlatformHypersonicImpl.java.patch
>
> Using hsqldb with id-method native columns creates columns defined with the constraint "IDENTITY". This generated an index starting with 0. As Torque regards objects with an primary key 0 as not initialized, this can lead to problems when using relationships between tables. 
> To prevent this I've patched the generated string from "IDENTITY" to "GENERATED BY DEFAULT AS IDENTITY (STARTING WITH 0)".
> This broke the created SQL for hsqldb tables since Torque preprends the String "NOT NULL" in front of the identity string. hsqldb does not allow this.
> To change this I've patched the interface org.apache.torque.engine.platform.Platform and added a method "public getNullString(Column col)" since the PlatformHypersonicImpl needed to know if the column is a not null and if the column uses the native id-method. The default implementation of Platform delegates the call of this method to the former existing one. Only the hsqldb implementation uses more than the property notNull of the column.
> The new method is now used getSqlString of class Column.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


[jira] Resolved: (TORQUE-32) Native id-method columns in hsqldb start with 0

Posted by "Thomas Fischer (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/TORQUE-32?page=all ]
     
Thomas Fischer resolved TORQUE-32:
----------------------------------

    Fix Version: 3.2.1
     Resolution: Fixed

The problem is already resolved in SVN, however, the patch was not used as is. The problem with the attached patch was that it did not allow not-nullable primary keys for HSQLDB, which is perfectly possible. Instead, the not null clause was moved to the correct position for HSQLDB by adding the createNotNullBeforeAutoincrement() method in the Platform interface.
There are still some problems in the test project with creating tables, but these are nit because of this issues, but because autoincrement not being possible for certain data types.

> Native id-method columns in hsqldb start with 0
> -----------------------------------------------
>
>          Key: TORQUE-32
>          URL: http://issues.apache.org/jira/browse/TORQUE-32
>      Project: Torque
>         Type: Bug

>   Components: Generator
>  Environment: Any.
>     Reporter: Scott Eade
>     Assignee: Thomas Fischer
>     Priority: Minor
>      Fix For: 3.2.1
>  Attachments: Column.java.patch, HypersonicDomainTest.java.patch, Platform.java.patch, PlatformDefaultImpl.java.patch, PlatformHypersonicImpl.java.patch
>
> Using hsqldb with id-method native columns creates columns defined with the constraint "IDENTITY". This generated an index starting with 0. As Torque regards objects with an primary key 0 as not initialized, this can lead to problems when using relationships between tables. 
> To prevent this I've patched the generated string from "IDENTITY" to "GENERATED BY DEFAULT AS IDENTITY (STARTING WITH 0)".
> This broke the created SQL for hsqldb tables since Torque preprends the String "NOT NULL" in front of the identity string. hsqldb does not allow this.
> To change this I've patched the interface org.apache.torque.engine.platform.Platform and added a method "public getNullString(Column col)" since the PlatformHypersonicImpl needed to know if the column is a not null and if the column uses the native id-method. The default implementation of Platform delegates the call of this method to the former existing one. Only the hsqldb implementation uses more than the property notNull of the column.
> The new method is now used getSqlString of class Column.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


[jira] Commented: (TORQUE-32) Native id-method columns in hsqldb start with 0

Posted by "Scott Eade (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/TORQUE-32?page=comments#action_12416842 ] 

Scott Eade commented on TORQUE-32:
----------------------------------

Some, but not all of the changes in the attached patch have been committed.

I thought it best to at least store the detail here until a Hypersonic user can confirm whether or not the rest of the patch needs to be applied.

Scott

> Native id-method columns in hsqldb start with 0
> -----------------------------------------------
>
>          Key: TORQUE-32
>          URL: http://issues.apache.org/jira/browse/TORQUE-32
>      Project: Torque
>         Type: Bug

>   Components: Generator
>  Environment: Any.
>     Reporter: Scott Eade
>     Priority: Minor

>
> Using hsqldb with id-method native columns creates columns defined with the constraint "IDENTITY". This generated an index starting with 0. As Torque regards objects with an primary key 0 as not initialized, this can lead to problems when using relationships between tables. 
> To prevent this I've patched the generated string from "IDENTITY" to "GENERATED BY DEFAULT AS IDENTITY (STARTING WITH 0)".
> This broke the created SQL for hsqldb tables since Torque preprends the String "NOT NULL" in front of the identity string. hsqldb does not allow this.
> To change this I've patched the interface org.apache.torque.engine.platform.Platform and added a method "public getNullString(Column col)" since the PlatformHypersonicImpl needed to know if the column is a not null and if the column uses the native id-method. The default implementation of Platform delegates the call of this method to the former existing one. Only the hsqldb implementation uses more than the property notNull of the column.
> The new method is now used getSqlString of class Column.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


[jira] Updated: (TORQUE-32) Native id-method columns in hsqldb start with 0

Posted by "Scott Eade (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/TORQUE-32?page=all ]

Scott Eade updated TORQUE-32:
-----------------------------

    Attachment: Column.java.patch
                HypersonicDomainTest.java.patch
                Platform.java.patch

> Native id-method columns in hsqldb start with 0
> -----------------------------------------------
>
>          Key: TORQUE-32
>          URL: http://issues.apache.org/jira/browse/TORQUE-32
>      Project: Torque
>         Type: Bug

>   Components: Generator
>  Environment: Any.
>     Reporter: Scott Eade
>     Priority: Minor
>  Attachments: Column.java.patch, HypersonicDomainTest.java.patch, Platform.java.patch, PlatformDefaultImpl.java.patch, PlatformHypersonicImpl.java.patch
>
> Using hsqldb with id-method native columns creates columns defined with the constraint "IDENTITY". This generated an index starting with 0. As Torque regards objects with an primary key 0 as not initialized, this can lead to problems when using relationships between tables. 
> To prevent this I've patched the generated string from "IDENTITY" to "GENERATED BY DEFAULT AS IDENTITY (STARTING WITH 0)".
> This broke the created SQL for hsqldb tables since Torque preprends the String "NOT NULL" in front of the identity string. hsqldb does not allow this.
> To change this I've patched the interface org.apache.torque.engine.platform.Platform and added a method "public getNullString(Column col)" since the PlatformHypersonicImpl needed to know if the column is a not null and if the column uses the native id-method. The default implementation of Platform delegates the call of this method to the former existing one. Only the hsqldb implementation uses more than the property notNull of the column.
> The new method is now used getSqlString of class Column.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org