You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@gora.apache.org by "Enis Soztutar (JIRA)" <ji...@apache.org> on 2010/11/15 07:42:13 UTC

[jira] Created: (GORA-15) Primitive types cannot be used as keys in DataStore

Primitive types cannot be used as keys in DataStore
---------------------------------------------------

                 Key: GORA-15
                 URL: https://issues.apache.org/jira/browse/GORA-15
             Project: Gora
          Issue Type: Bug
          Components: storage
    Affects Versions: 0.1-incubating
            Reporter: Enis Soztutar
            Assignee: Enis Soztutar


We cannot use primitive wrapper classes(Long, Integer, etc) in DataStore as keys since BeanFactoryImpl needs a no-arg constructor.

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


[jira] Commented: (GORA-15) Primitive types cannot be used as keys in DataStore

Posted by "Henry Saputra (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/GORA-15?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12932375#action_12932375 ] 

Henry Saputra commented on GORA-15:
-----------------------------------

+1

> Primitive types cannot be used as keys in DataStore
> ---------------------------------------------------
>
>                 Key: GORA-15
>                 URL: https://issues.apache.org/jira/browse/GORA-15
>             Project: Gora
>          Issue Type: Bug
>          Components: storage
>    Affects Versions: 0.1-incubating
>            Reporter: Enis Soztutar
>            Assignee: Enis Soztutar
>         Attachments: gora-15_v1.patch
>
>
> We cannot use primitive wrapper classes(Long, Integer, etc) in DataStore as keys since BeanFactoryImpl needs a no-arg constructor.

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


[jira] Updated: (GORA-15) Primitive types cannot be used as keys in DataStore

Posted by "Enis Soztutar (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/GORA-15?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Enis Soztutar updated GORA-15:
------------------------------

    Attachment: gora-15_v1.patch

Attaching a patch so that primitive types can be used as keys. 

> Primitive types cannot be used as keys in DataStore
> ---------------------------------------------------
>
>                 Key: GORA-15
>                 URL: https://issues.apache.org/jira/browse/GORA-15
>             Project: Gora
>          Issue Type: Bug
>          Components: storage
>    Affects Versions: 0.1-incubating
>            Reporter: Enis Soztutar
>            Assignee: Enis Soztutar
>         Attachments: gora-15_v1.patch
>
>
> We cannot use primitive wrapper classes(Long, Integer, etc) in DataStore as keys since BeanFactoryImpl needs a no-arg constructor.

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


[jira] Commented: (GORA-15) Primitive types cannot be used as keys in DataStore

Posted by "Henry Saputra (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/GORA-15?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12932364#action_12932364 ] 

Henry Saputra commented on GORA-15:
-----------------------------------

So the fix is actually to avoid throwing no method exception when initialize the DataStore for those Classes without no argument  constructor such as primitive wrapper classes?



> Primitive types cannot be used as keys in DataStore
> ---------------------------------------------------
>
>                 Key: GORA-15
>                 URL: https://issues.apache.org/jira/browse/GORA-15
>             Project: Gora
>          Issue Type: Bug
>          Components: storage
>    Affects Versions: 0.1-incubating
>            Reporter: Enis Soztutar
>            Assignee: Enis Soztutar
>         Attachments: gora-15_v1.patch
>
>
> We cannot use primitive wrapper classes(Long, Integer, etc) in DataStore as keys since BeanFactoryImpl needs a no-arg constructor.

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


[jira] Commented: (GORA-15) Primitive types cannot be used as keys in DataStore

Posted by "Enis Soztutar (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/GORA-15?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12932022#action_12932022 ] 

Enis Soztutar commented on GORA-15:
-----------------------------------

Yes, but if the class does not define no-arg c.tor this means that new keys cannot be created. 
Calling DataStore#newKey() will throw an exception with the appropriate message. Is this acceptable? 

> Primitive types cannot be used as keys in DataStore
> ---------------------------------------------------
>
>                 Key: GORA-15
>                 URL: https://issues.apache.org/jira/browse/GORA-15
>             Project: Gora
>          Issue Type: Bug
>          Components: storage
>    Affects Versions: 0.1-incubating
>            Reporter: Enis Soztutar
>            Assignee: Enis Soztutar
>         Attachments: gora-15_v1.patch
>
>
> We cannot use primitive wrapper classes(Long, Integer, etc) in DataStore as keys since BeanFactoryImpl needs a no-arg constructor.

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


[jira] Commented: (GORA-15) Primitive types cannot be used as keys in DataStore

Posted by "Henry Saputra (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/GORA-15?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12932005#action_12932005 ] 

Henry Saputra commented on GORA-15:
-----------------------------------

If the class does not have no-arg constructor the BeanFactory instance will have NULL keyConstructor to generate new key?

> Primitive types cannot be used as keys in DataStore
> ---------------------------------------------------
>
>                 Key: GORA-15
>                 URL: https://issues.apache.org/jira/browse/GORA-15
>             Project: Gora
>          Issue Type: Bug
>          Components: storage
>    Affects Versions: 0.1-incubating
>            Reporter: Enis Soztutar
>            Assignee: Enis Soztutar
>         Attachments: gora-15_v1.patch
>
>
> We cannot use primitive wrapper classes(Long, Integer, etc) in DataStore as keys since BeanFactoryImpl needs a no-arg constructor.

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


[jira] Resolved: (GORA-15) Primitive types cannot be used as keys in DataStore

Posted by "Enis Soztutar (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/GORA-15?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Enis Soztutar resolved GORA-15.
-------------------------------

       Resolution: Fixed
    Fix Version/s: 0.1-incubating

I have committed this with the below javadoc. Thanks guys. 

{code}
  /**
   * Returns a new instance of the key object. If the object cannot be instantiated 
   * (it the class is a Java primitive wrapper, or does not have no-arg 
   * constructor) it throws an exception. Only use this function if you can 
   * make sure that the key class has a no-arg constructor.   
   * @return a new instance of the key object.
   */
  public abstract K newKey() throws IOException;
{code}

> Primitive types cannot be used as keys in DataStore
> ---------------------------------------------------
>
>                 Key: GORA-15
>                 URL: https://issues.apache.org/jira/browse/GORA-15
>             Project: Gora
>          Issue Type: Bug
>          Components: storage
>    Affects Versions: 0.1-incubating
>            Reporter: Enis Soztutar
>            Assignee: Enis Soztutar
>             Fix For: 0.1-incubating
>
>         Attachments: gora-15_v1.patch
>
>
> We cannot use primitive wrapper classes(Long, Integer, etc) in DataStore as keys since BeanFactoryImpl needs a no-arg constructor.

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


[jira] Commented: (GORA-15) Primitive types cannot be used as keys in DataStore

Posted by "Enis Soztutar (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/GORA-15?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12932365#action_12932365 ] 

Enis Soztutar commented on GORA-15:
-----------------------------------

Yes indeed. 

> Primitive types cannot be used as keys in DataStore
> ---------------------------------------------------
>
>                 Key: GORA-15
>                 URL: https://issues.apache.org/jira/browse/GORA-15
>             Project: Gora
>          Issue Type: Bug
>          Components: storage
>    Affects Versions: 0.1-incubating
>            Reporter: Enis Soztutar
>            Assignee: Enis Soztutar
>         Attachments: gora-15_v1.patch
>
>
> We cannot use primitive wrapper classes(Long, Integer, etc) in DataStore as keys since BeanFactoryImpl needs a no-arg constructor.

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


[jira] Commented: (GORA-15) Primitive types cannot be used as keys in DataStore

Posted by "Andrzej Bialecki (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/GORA-15?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12932456#action_12932456 ] 

Andrzej Bialecki  commented on GORA-15:
---------------------------------------

+1. I think that javadoc for DataStore.newKey() should mention that it will throw exception on primitive keys.

> Primitive types cannot be used as keys in DataStore
> ---------------------------------------------------
>
>                 Key: GORA-15
>                 URL: https://issues.apache.org/jira/browse/GORA-15
>             Project: Gora
>          Issue Type: Bug
>          Components: storage
>    Affects Versions: 0.1-incubating
>            Reporter: Enis Soztutar
>            Assignee: Enis Soztutar
>         Attachments: gora-15_v1.patch
>
>
> We cannot use primitive wrapper classes(Long, Integer, etc) in DataStore as keys since BeanFactoryImpl needs a no-arg constructor.

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