You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Laird Nelson (JIRA)" <ji...@apache.org> on 2010/02/16 14:41:28 UTC

[jira] Created: (OPENJPA-1514) DBDictionary instances do not call setAutoAssigned() where appropriate

DBDictionary instances do not call setAutoAssigned() where appropriate
----------------------------------------------------------------------

                 Key: OPENJPA-1514
                 URL: https://issues.apache.org/jira/browse/OPENJPA-1514
             Project: OpenJPA
          Issue Type: Bug
          Components: sql
    Affects Versions: 2.0.0-beta, 2.0.0-M3, 2.0.0-M2, 2.0.0-M1, 1.2.2, 1.2.1, 1.2.0, 1.1.0, 1.0.3, 1.0.2, 1.0.1, 1.0.0, 1.0.4, 1.0.5, 1.1.1, 1.2.3, 1.3.0, 2.0.0, 2.0.1, 2.1.0
            Reporter: Laird Nelson


Although a DBDictionary instance by definition has access to the database's information that would allow it to mark a new Column as being autoassigned, DBDictionaries do not do this in their newColumn() method.  It seems to me that all DBDictinonary instances should be required by contract to detect when a column is a database-managed identity or sequential column and should call Column#setAutoAssigned(boolean) as appropriate.

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


[jira] Commented: (OPENJPA-1514) DBDictionary instances do not call setAutoAssigned() where appropriate

Posted by "Fay Wang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-1514?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12838442#action_12838442 ] 

Fay Wang commented on OPENJPA-1514:
-----------------------------------

Setting autoAssigned to true in a column is determined by the annotation:

    @Id
    @GeneratedValue(strategy=GenerationType.IDENTITY)
    private int id;

This annotation determines the strategy to be used in the field and class meta data to generate the correct sql.

Even though DBDictionary can access database to get column information, presumably through jdbc call of DatabaseMetaData.getColumns, the ResultSet returns from getColumns does not contain the information on whether a column is a generated column or not.

> DBDictionary instances do not call setAutoAssigned() where appropriate
> ----------------------------------------------------------------------
>
>                 Key: OPENJPA-1514
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1514
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: sql
>    Affects Versions: 1.0.0, 1.0.1, 1.0.2, 1.0.3, 1.0.4, 1.0.5, 1.1.0, 1.1.1, 1.2.0, 1.2.1, 1.2.2, 1.2.3, 1.3.0, 2.0.0-M1, 2.0.0-M2, 2.0.0-M3, 2.0.0-beta, 2.0.0, 2.0.1, 2.1.0
>            Reporter: Laird Nelson
>
> Although a DBDictionary instance by definition has access to the database's information that would allow it to mark a new Column as being autoassigned, DBDictionaries do not do this in their newColumn() method.  It seems to me that all DBDictinonary instances should be required by contract to detect when a column is a database-managed identity or sequential column and should call Column#setAutoAssigned(boolean) as appropriate.

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


[jira] Commented: (OPENJPA-1514) DBDictionary instances do not call setAutoAssigned() where appropriate

Posted by "Laird Nelson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-1514?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12838445#action_12838445 ] 

Laird Nelson commented on OPENJPA-1514:
---------------------------------------

Hi, Fay; they certainly do in Java 6.  See the IS_AUTOASSIGNED value in the ResultSet returned by getColumns().

Also, the use case I am looking at is going the "other way": from a SchemaGenerator through to the ReverseMappingTool.  I need the ReverseMappingTool to be able to output @GeneratedValue where appropriate.

> DBDictionary instances do not call setAutoAssigned() where appropriate
> ----------------------------------------------------------------------
>
>                 Key: OPENJPA-1514
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1514
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: sql
>    Affects Versions: 1.0.0, 1.0.1, 1.0.2, 1.0.3, 1.0.4, 1.0.5, 1.1.0, 1.1.1, 1.2.0, 1.2.1, 1.2.2, 1.2.3, 1.3.0, 2.0.0-M1, 2.0.0-M2, 2.0.0-M3, 2.0.0-beta, 2.0.0, 2.0.1, 2.1.0
>            Reporter: Laird Nelson
>
> Although a DBDictionary instance by definition has access to the database's information that would allow it to mark a new Column as being autoassigned, DBDictionaries do not do this in their newColumn() method.  It seems to me that all DBDictinonary instances should be required by contract to detect when a column is a database-managed identity or sequential column and should call Column#setAutoAssigned(boolean) as appropriate.

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